[hackers] [wmii] Fix some bugs related to windows which automagically float, and subsequent actions. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Mon, 15 Sep 2008 23:30:52 +0000 (UTC)

changeset: 2347:a740669de38d
tag: tip
user: Kris Maglione <jg_AT_suckless.org>
date: Mon Sep 15 19:30:47 2008 -0400
files: cmd/wmii/float.c cmd/wmii/view.c
description:
Fix some bugs related to windows which automagically float, and subsequent actions.

diff -r af3bdd290932 -r a740669de38d cmd/wmii/float.c
--- a/cmd/wmii/float.c Sun Sep 07 23:09:25 2008 -0400
+++ b/cmd/wmii/float.c Mon Sep 15 19:30:47 2008 -0400
@@ -24,12 +24,13 @@
 void
 float_detach(Frame *f) {
         Frame *pr;
- Area *a, *sel;
+ Area *a, *sel, *oldsel;
         View *v;
 
         v = f->view;
         a = f->area;
         sel = view_findarea(v, v->selcol, false);
+ oldsel = v->oldsel;
         if(!(sel || !v->area->next)) warning("%s:%d: !(sel || !v->area->next)", __FILE__, __LINE__);
         pr = f->aprev;
 
@@ -43,8 +44,8 @@
         }
         f->area = nil;
 
- if(v->oldsel)
- area_focus(v->oldsel);
+ if(oldsel)
+ area_focus(oldsel);
         else if(!a->frame)
                 if(sel && sel->frame)
                         area_focus(sel);
diff -r af3bdd290932 -r a740669de38d cmd/wmii/view.c
--- a/cmd/wmii/view.c Sun Sep 07 23:09:25 2008 -0400
+++ b/cmd/wmii/view.c Mon Sep 15 19:30:47 2008 -0400
@@ -300,20 +300,27 @@
 view_attach(View *v, Frame *f) {
         Client *c;
         Frame *ff;
- Area *a;
+ Area *a, *oldsel;
         
         c = f->client;
 
+ oldsel = nil;
         a = v->sel;
         if(client_floats_p(c)) {
                 if(v->sel != v->area)
- v->oldsel = v->sel;
+ oldsel = v->sel;
                 a = v->area;
         }
         else if((ff = client_groupframe(c, v)))
                 a = ff->area;
         else if(v->sel->floating) {
- if(starting || c->sel && c->sel->area && !c->sel->area->floating)
+ if(v->oldsel)
+ a = v->oldsel;
+ /* Don't float a frame when starting or when its
+ * last focused frame didn't float. Important when
+ * tagging with +foo.
+ */
+ else if(starting || c->sel && c->sel->area && !c->sel->area->floating)
                         a = v->area->next;
         }
 
@@ -331,6 +338,9 @@
                         /* XXX: Stack. */
                         area_setsel(f->area, f);
         }
+
+ if(oldsel)
+ v->oldsel = oldsel;
 
         if(c->sel == nil)
                 c->sel = f;
Received on Mon Sep 15 2008 - 23:30:52 UTC

This archive was generated by hypermail 2.2.0 : Mon Sep 15 2008 - 23:36:04 UTC