'Cycle through windows' feature request

Sami Samhuri sami at no-eff-eks.com
Mon Aug 2 03:25:57 CEST 2004


* It was Fri, Jul 30, 2004 at 10:04:54PM -0500 when Andrew Conkling said:
> Some time ago (probably on Mon, 26 Jul 2004 10:41:59 +0200)
> Nikolas Arend had the occasion to say the following:
> > Nikolas Arend wrote:
> > > It would be great, if there was an option to only cycle through those
> > > windows on the desktop, that are currently not minimised. Now if you 
> > > start cycling using Alt-Tab, all windows get included in the cycle, 
> > > even those that were/are minimised.
[...]
> Is it too late to second this feature? ;-)
> Maybe an option so that all could be pleased.

I had taken a brief look at doing this last week or so. It's quite
trivial to implement and I think I will enjoy using it combined with a
minimised-only iconbox. I don't like giving up screen space to the
taskbar, if the alt-tab dialog showed a list of windows rather than one
at a time, I would easily forget the taskbar. Maybe I'll give that a
shot another day.

Anyways, I've attached a patch against the current CVS. The patch
implements an option called cycle_hidden which is analagous to
cycle_minimum. Edit/create ~/.xfce4/xfwm4rc and add the line:
    
    cycle_hidden=false

to disable hidden windows from being displayed in the alt-tab dialog.

Any suggestions/comments are much appreciated since this is the first
patch I've sent out anywhere. I know it's small, but I'm sure someone
can find something wrong with it. :)

Cheers,

-- 
Sami Samhuri
-------------- next part --------------
diff -Naur xfwm4/defaults/defaults xfwm4-cycle_hidden/defaults/defaults
--- xfwm4/defaults/defaults	2004-07-07 12:18:10.000000000 -0700
+++ xfwm4-cycle_hidden/defaults/defaults	2004-08-01 17:59:21.955351688 -0700
@@ -6,6 +6,7 @@
 button_offset=0
 button_spacing=1
 click_to_focus=true
+cycle_hidden=true
 cycle_minimum=true
 dbl_click_time=400
 double_click_action=maximize
diff -Naur xfwm4/doc/C/xfwm4.html xfwm4-cycle_hidden/doc/C/xfwm4.html
--- xfwm4/doc/C/xfwm4.html	2004-07-14 13:56:40.000000000 -0700
+++ xfwm4-cycle_hidden/doc/C/xfwm4.html	2004-08-01 18:03:27.075087824 -0700
@@ -41,7 +41,12 @@
 	    If you want the panel, and apps that do not appear in the taskbar, 
 	    to be included when you switch the focus using the Alt+Tab 
 	    shortcut, edit your $HOME/.xfce4/xfwm4rc (or create an new one) 
-	    and add this line : cycle_minimum=false</p><p>NOTE: the use of a keyboard shortcut in an application needs 
+	    and add this line : cycle_minimum=false
+	  </p><p>
+	    To exclude hidden windows from the list presented when using
+		Alt+Tab edit your $HOME/.xfce4/xfwm4rc (or create a new one) and
+		add this line : cycle_hidden=false
+	  </p><p>NOTE: the use of a keyboard shortcut in an application needs 
 	    the application window to have the focus :)
 	  </p></dd><dt><span class="term">Maximize / unmaximize windows</span></dt><dd><p>If you maximize a window, it will expand on your display and use
 	  all avaible space (as it is defined by <a href="xfdesktop.html#xfdesktop-workspace" target="_top">workspace
diff -Naur xfwm4/doc/C/xfwm4.xml xfwm4-cycle_hidden/doc/C/xfwm4.xml
--- xfwm4/doc/C/xfwm4.xml	2004-07-14 13:56:40.000000000 -0700
+++ xfwm4-cycle_hidden/doc/C/xfwm4.xml	2004-08-01 18:03:27.078087368 -0700
@@ -179,6 +179,12 @@
 	    shortcut, edit your $HOME/.xfce4/xfwm4rc (or create an new one) 
 	    and add this line : cycle_minimum=false</para>
 	  
+	  <para>
+	    To exclude hidden windows from the list presented when using
+		Alt+Tab edit your $HOME/.xfce4/xfwm4rc (or create a new one) and
+		add this line : cycle_hidden=false
+	  </para>
+
 	  <para>NOTE: the use of a keyboard shortcut in an application needs 
 	    the application window to have the focus :)
 	  </para>
diff -Naur xfwm4/src/client.c xfwm4-cycle_hidden/src/client.c
--- xfwm4/src/client.c	2004-07-06 15:22:28.000000000 -0700
+++ xfwm4-cycle_hidden/src/client.c	2004-08-01 17:59:13.104697192 -0700
@@ -3536,13 +3536,17 @@
     }
 
     myDisplayGrabServer (display_info);
-    if (screen_info->params->cycle_minimum)
+    if (screen_info->params->cycle_hidden)
+	{
+		passdata.cycle_range = INCLUDE_HIDDEN;
+	}
+	else
+	{
+		passdata.cycle_range = 0;
+	}
+    if (!screen_info->params->cycle_minimum)
     {
-        passdata.cycle_range = INCLUDE_HIDDEN;
-    }
-    else
-    {
-        passdata.cycle_range = INCLUDE_HIDDEN | INCLUDE_SKIP_TASKBAR | INCLUDE_SKIP_PAGER;
+        passdata.cycle_range |= INCLUDE_SKIP_TASKBAR | INCLUDE_SKIP_PAGER;
     }
     passdata.c = clientGetNext (c, passdata.cycle_range);
     if (passdata.c)
diff -Naur xfwm4/src/settings.c xfwm4-cycle_hidden/src/settings.c
--- xfwm4/src/settings.c	2004-07-05 13:45:07.000000000 -0700
+++ xfwm4-cycle_hidden/src/settings.c	2004-08-01 18:06:27.733623552 -0700
@@ -966,6 +966,7 @@
         {"button_offset", NULL, TRUE},
         {"button_spacing", NULL, TRUE},
         {"click_to_focus", NULL, TRUE},
+        {"cycle_hidden", NULL, TRUE},
         {"cycle_minimum", NULL, FALSE},
         {"dbl_click_time", NULL, TRUE},
         {"double_click_action", NULL, TRUE},
@@ -1085,6 +1086,8 @@
         !g_ascii_strcasecmp ("true", getValue ("easy_click", rc));
     screen_info->params->cycle_minimum =
         !g_ascii_strcasecmp ("true", getValue ("cycle_minimum", rc));
+    screen_info->params->cycle_hidden =
+        !g_ascii_strcasecmp ("true", getValue ("cycle_hidden", rc));
     screen_info->params->focus_hint =
         !g_ascii_strcasecmp ("true", getValue ("focus_hint", rc));
     screen_info->params->focus_new =
diff -Naur xfwm4/src/settings.h xfwm4-cycle_hidden/src/settings.h
--- xfwm4/src/settings.h	2004-06-24 13:11:07.000000000 -0700
+++ xfwm4-cycle_hidden/src/settings.h	2004-08-01 18:06:27.736623096 -0700
@@ -147,6 +147,7 @@
     int title_horizontal_offset;
     int wrap_resistance;
     gboolean title_shadow[2];
+    gboolean cycle_hidden;
     gboolean cycle_minimum;
     gboolean box_move;
     gboolean box_resize;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <http://mail.xfce.org/pipermail/xfce/attachments/20040801/b963c561/attachment.pgp>


More information about the Xfce mailing list