[compiz] sticky windows and rotate focus

Steve Leung sjleung at shaw.ca
Sat Mar 3 09:31:27 PST 2007


Hi everyone,

One thing that has always annoyed me about compiz is how rotate
handles sticky windows.  If you have a sticky window on your desktop,
it will usually (always?) get focus when you rotate to a different
face on the cube.  This happens even when other windows have been
focused more recently on the face you rotate to.

This seems like silly behaviour, because sticky windows are (for me)
'background' windows like media players, IM clients, and so on.  The
non-sticky windows are where I do all my work, so focus should go
there whenever I rotate faces.

I've attached a patch that fixes this.  It makes focusDefaultWindow
only focus a sticky window if it already had focus.  This means that
if you do focus a sticky window and rotate faces, that window will
stay focused.

I'm not really sure what other consequences this change has, but I
haven't found any problems so far.  Can anyone offer some advice?

Steve
-------------- next part --------------
diff --git a/src/display.c b/src/display.c
index 9dcf0a1..5c763b3 100644
--- a/src/display.c
+++ b/src/display.c
@@ -3135,7 +3135,12 @@ focusDefaultWindow (CompDisplay *d)
 		    }
 		}
 		else
-		    focus = w;
+		{
+		    /* only focus sticky window if it already had focus */
+		    if (!(w->state & CompWindowStateStickyMask) ||
+			w->id == d->activeWindow)
+			focus = w;
+		}
 	    }
 	}
     }


More information about the compiz mailing list