[hackers] [wmii] Try harder to find the right screen for new fullscreen windows. Closes issue #164. || Kris Maglione

From: <hg_AT_suckless.org>
Date: Sun, 24 Jan 2010 01:16:18 +0000 (UTC)

changeset: 2599:c1f273cf361d
tag: tip
user: Kris Maglione <kris_AT_suckless.org>
date: Sat Jan 23 20:16:10 2010 -0500
files: cmd/wmii/client.c cmd/wmii/dat.h
description:
Try harder to find the right screen for new fullscreen windows. Closes issue #164.

diff -r 5c894ec1ad44 -r c1f273cf361d cmd/wmii/client.c
--- a/cmd/wmii/client.c Sat Jan 23 18:48:26 2010 -0500
+++ b/cmd/wmii/client.c Sat Jan 23 20:16:10 2010 -0500
@@ -609,9 +609,10 @@
 
 void
 fullscreen(Client *c, int fullscreen, long screen) {
+ Client *leader;
         Frame *f;
         bool wassel;
-
+
         if(fullscreen == Toggle)
                 fullscreen = (c->fullscreen >= 0) ^ On;
         if(fullscreen == (c->fullscreen >= 0))
@@ -638,7 +639,16 @@
                         }
                 }
         else {
- c->fullscreen = screen >= 0 ? screen : ownerscreen(c->r);
+ c->fullscreen = 0;
+ if(screen >= 0)
+ c->fullscreen = screen;
+ else if(c->sel)
+ c->fullscreen = ownerscreen(c->r);
+ else if(c->group && (leader = group_leader(c->group)) && leader->sel)
+ c->fullscreen = ownerscreen(leader->r);
+ else if(selclient())
+ c->fullscreen = ownerscreen(selclient()->r);
+
                 for(f=c->frame; f; f=f->cnext)
                         f->oldarea = -1;
                 if((f = c->sel))
@@ -758,11 +768,11 @@
 
         c->borderless = 0;
         c->titleless = 0;
- if(n >= 3 && (ret[Flags]&FlagDecor)) {
- if(ret[Decor]&All)
+ if(n >= 3 && (ret[Flags] & FlagDecor)) {
+ if(ret[Decor] & All)
                         ret[Decor] ^= ~0;
- c->borderless = !(ret[Decor]&Border);
- c->titleless = !(ret[Decor]&Title);
+ c->borderless = !(ret[Decor] & Border);
+ c->titleless = !(ret[Decor] & Title);
         }
         free(ret);
 
@@ -826,7 +836,7 @@
                 update_class(c);
                 break;
         case XA_WM_NAME:
-wmname:
+ wmname:
                 client_updatename(c);
                 break;
         }
diff -r 5c894ec1ad44 -r c1f273cf361d cmd/wmii/dat.h
--- a/cmd/wmii/dat.h Sat Jan 23 18:48:26 2010 -0500
+++ b/cmd/wmii/dat.h Sat Jan 23 20:16:10 2010 -0500
@@ -183,12 +183,12 @@
         uint border;
         int fullscreen;
         int unmapped;
- char floating;
- char fixedsize;
- char urgent;
- char borderless;
- char titleless;
- char noinput;
+ bool floating;
+ bool fixedsize;
+ bool urgent;
+ bool borderless;
+ bool titleless;
+ bool noinput;
 };
 
 struct Divide {
Received on Sun Jan 24 2010 - 01:16:18 UTC

This archive was generated by hypermail 2.2.0 : Sun Jan 24 2010 - 01:24:06 UTC