* At 2002-04-29T23:22+0200, Stian Sletner wrote:
| * At 2002-04-29T21:41+0200, Stian Sletner wrote:
| | * At 2002-04-29T19:32+0000, Mikhael Goikhman wrote:
| | : 
| | | Patches should be done using "diff -u" unless your diff only supports -c.
| | | Patches should be done againt the latest version (one of the latest daily
| | | snapshot is ok).
| | | Patches should include changes to fvwm.1 and a ChangeLog entry.
| | | 
| | | Please save us the time. Otherwise whoever applies your patch should spend
| | | time to understand a hard-to-read "diff -c" output, manually port the
| | | patch from 2.4.x to 2.5.x, manually separate already applied CurrentAtEnd
| | | patch from yours, write a man page entry. At this point it is easier to
| | | implement the feature from stratch. :)  Thank you and happy patching.
| | 
| | That should probably be done anyway.  Nevermind, thanks.
| 
| On second thought, I have nothing better to do.  I'll tro and do it
| again, following your instructions.

Ok, how's this?  Patched against cvs current, default branch.

Index: ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.1772
diff -u -u -r1.1772 ChangeLog
--- ChangeLog   2002/04/29 15:52:49     1.1772
+++ ChangeLog   2002/04/29 22:00:20
@@ -1,3 +1,8 @@
+2002-04-29  Stian Sletner  <[EMAIL PROTECTED]>
+
+       * fvwm/windowlist.c (CMD_WindowList):
+       Added new Windowlist option IconifiedAtEnd
+
 2002-04-29  olicha  <[EMAIL PROTECTED]>
 
        * libs/FlocaleCharset.c (FlocaleCharsetSetFlocaleCharset):
Index: fvwm/fvwm.1
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/fvwm.1,v
retrieving revision 1.6
diff -u -u -r1.6 fvwm.1
--- fvwm/fvwm.1 2002/04/25 21:57:02     1.6
+++ fvwm/fvwm.1 2002/04/29 22:01:38
@@ -3704,6 +3704,7 @@
 .IR NoDeskSort ,
 .IR ReverseOrder ,
 .IR CurrentAtEnd ,
+.IR IconifiedAtEnd ,
 .IR UseIconName ,
 .IR Alphabetic " / " NotAlphabetic ,
 .IR NoHotkeys ,
@@ -3742,6 +3743,10 @@
 option the currently focused window (if any) is shown at the bottom
 of the list.  This is mostly intended for simulating the Alt-Tab
 behaviour in another GUI.
+
+.I IconifiedAtEnd
+makes iconified windows be moved to the end of the list.  This is also
+from another GUI.
 
 The
 .I NoGeometry
Index: fvwm/windowlist.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/windowlist.c,v
retrieving revision 1.58
diff -u -u -r1.58 windowlist.c
--- fvwm/windowlist.c   2002/04/23 01:26:53     1.58
+++ fvwm/windowlist.c   2002/04/29 22:01:46
@@ -119,6 +119,7 @@
   char* ret_action = NULL;
   FvwmWindow *t;
   FvwmWindow **windowList;
+  FvwmWindow **iconifiedList;
   int numWindows;
   int ii;
   char tname[80];
@@ -154,6 +155,9 @@
   Bool use_condition = False;
   Bool do_reverse_sort_order = False;
   Bool current_at_end = False;
+  Bool iconified_at_end = False;
+  int ic = 0;
+  int ij;
   WindowConditionMask mask;
   char *cond_flags;
   Bool first_desk = True;
@@ -222,6 +226,8 @@
         do_reverse_sort_order = True;
       else if (StrEquals(tok,"CurrentAtEnd"))
         current_at_end = True;
+      else if (StrEquals(tok,"IconifiedAtEnd"))
+        iconified_at_end = True;
       else if (StrEquals(tok,"NoDeskSort"))
         flags |= NO_DESK_SORT;
       else if (StrEquals(tok,"UseIconName"))
@@ -362,6 +368,14 @@
   {
     return;
   }
+  if (iconified_at_end)
+  {
+    iconifiedList = malloc(numWindows*sizeof(t));
+    if (iconifiedList == NULL)
+    {
+      return;
+    }
+  }
   /* get the windowlist starting from the current window (if any)*/
   t = get_focus_window();
   if (t == NULL)
@@ -376,13 +390,24 @@
   {
     if (do_reverse_sort_order)
       windowList[numWindows - ii - 1] = t;
+    else if (iconified_at_end && IS_ICONIFIED(t))
+      iconifiedList[ic++] = t;
     else
-      windowList[ii] = t;
+      windowList[ii - ic] = t;
     if (t->next)
       t = t->next;
     else
       t = Scr.FvwmRoot.next;
   }
+  if (iconified_at_end && ic > 0)
+  {
+    if (current_at_end)
+      windowList[numWindows - 1] = windowList[--ii - ic];
+    for (ij = 0; ij < ic; ij++)
+    {
+      windowList[ij + (ii - ic)] = iconifiedList[ij];
+    }
+  }
 
   /* Do alphabetic sort */
   if (flags & SHOW_ALPHABETIC)
@@ -597,6 +622,8 @@
   if (func)
     free(func);
   free(windowList);
+  if (iconified_at_end)
+    free(iconifiedList);
   if (!default_action && eventp && eventp->type == KeyPress)
     teventp = (XEvent *)1;
   else

-- 
Stian Sletner
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [EMAIL PROTECTED]
To report problems, send mail to [EMAIL PROTECTED]

Reply via email to