Xfce/Xfwm: Focus & Raise selected Window while Alt-Tab-Cycling

Xfce4/Xfwm4 is my Window Manager of choice. It does almost everything right, except thing: managing windows. 😉

Seriously, it gets a real pain with >=5 windows. What’s really missing is an expose function like Compiz & the likes have.

To mitigate this a bit, i taught Xfwm4 how to raise the window that I currently <Alt>-<Tab>-cycle to. All it required was this mini-patch to 4.8.3:

--- xfwm4-4.8.3.orig/src/cycle.c
+++ xfwm4-4.8.3/src/cycle.c
@@ -314,6 +314,9 @@ clientCycleEventFilter (XEvent * xevent,
                     {
                         if (passdata->wireframe)
                         {
+                            /* -MODIFIED- start */
+                            clientCycleFocusAndRaise(c);
+                            /* -MODIFIED- stop */
                             wireframeUpdate (c, passdata->wireframe);
                         }
                     }

Makes life really easier. Xfwm4 is one of the last usable Window Managers (sorry, FVWM2, but without the advanced WindowList I basically have the same problem, just that the patch is more difficult!). When I have more time, I’ll figure something out for Expose.

Update: Here’s the patch for 4.10.1:

--- xfwm4-4.10.1.orig/src/cycle.c
+++ xfwm4-4.10.1/src/cycle.c 
@@ -334,6 +334,7 @@
                     {
                         if (passdata->wireframe)
                         { 
+                            clientCycleFocusAndRaise(c);
                             wireframeUpdate (c, passdata->wireframe);
                         }
                     }

Update: Here’s the patch for 4.12.3:

--- xfwm4-4.12.3.orig/src/cycle.c
+++ xfwm4-4.12.3/src/cycle.c
@@ -228,6 +228,7 @@ clientCycleUpdateWireframe (Client *c, C
     {
         if (passdata->wireframe)
         {
+            clientCycleFocusAndRaise(c);
             wireframeUpdate (c, passdata->wireframe);
         }
         return TRUE;