resize problem in FvwmIconMan

2002-04-26 Thread Derek B. Noonburg
I just installed 2.5.1 (which includes the weighted sorting patch I
submitted), and I'm seeing a strange bug in FvwmIconMan.  Sometimes when
I iconify a window, the FvwmIconMan window doesn't get resized to hold
the extra button.  (I have showonlyiconic turned on.)  Sometimes it
works, sometimes it doesn't.  If I uniconify the window and reiconify,
it usually ends up correct.  I did not see this behavior in 2.4.7 (also
with my patch).

I did some debugging within FvwmIconMan, and it looks like
XMoveResizeWindow is being called (from resize_window) with the correct
values, but the X server is just ignoring it.  XMoveResizeWindow is
always called correctly, but the results are random - sometimes the
window gets resizes, sometimes it doesn't.

I know the window manager interacts with the X server on window moves
and resizes, but I'm not familiar with the details, and I have no idea
how this would relate to module windows (if at all).  Did something get
changed in 2.5.x that would cause this problem?  Any other ideas?

- Derek


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


Re: FvwmIconMan - custom sorting

2002-04-25 Thread Derek B. Noonburg
Ok, here's the patch for the weighted sorting feature (renamed from
custom, following Larry Gensch's suggestion).  This is against the
latest code in CVS.

- Derek

? FvwmIconMan.patch
Index: modules/FvwmIconMan/FvwmIconMan.1
===
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconMan/FvwmIconMan.1,v
retrieving revision 1.21
diff -u -r1.21 FvwmIconMan.1
--- modules/FvwmIconMan/FvwmIconMan.1   2002/04/07 00:35:34 1.21
+++ modules/FvwmIconMan/FvwmIconMan.1   2002/04/25 07:25:18
@@ -113,6 +113,7 @@
 showlist of windows to show
 showonlyicons   only icons visible false
 sortkeep managers sorted   name
+sortweight  weight for sorting
 title   manager title  FvwmIconMan
 titlebutton style for title button raisededge black grey
 titlecolorset
@@ -285,8 +286,30 @@
 If \fIname\fP, then the manager list is sorted by name. If \fInamewithcase\fP,
 then it is sorted by name sensitive to case. If \fIid\fP, then
 the manager list is sorted by the window id, which never changes after the
-window is created. Or it can be set to \fInone\fP, which results in no sorting.
-Default is \fIname\fP.
+window is created. If \fIweighted\fP, then the manager list is sorted by
+weight (see the description of \fIsortweight\fP below). Or it can be set to
+\fInone\fP, which results in no sorting. Default is \fIname\fP.
+
+.IP *FvwmIconMan: [id ]sortweight \fIweight\fP \fIpattern-list\fP
+Assigns the specified \fIweight\fP to windows that match \fIpattern-list\fP.
+The list is made up of patterns of the form \fItype=pattern\fP, where type
+is one of \fIclass\fP, \fIresource\fP, \fItitle\fP, or \fIicon\fP, and pattern
+is an expression of the same format used in the fvwm style command
+(minimalistic shell pattern matching). Multiple sort weights can be given.
+Each window is matched against the list of sort weights, in order, and is
+given the weight from the first match. Lower-weighted windows are placed
+first in the manager list. For example:
+.EX
+*FvwmIconMan*sort   weighted
+*FvwmIconMan*sortweight 1 class=XTerm title=special*
+*FvwmIconMan*sortweight 10 class=XTerm
+*FvwmIconMan*sortweight 5
+.EE
+In this example, xterm windows whose titles start with special (weight 1)
+are listed first, followed by everything but other xterms (weight 5), and the
+other xterms (weight 10) are listed last. If no default weight (empty pattern
+list) is given, the default weight is 0. Only relevant if the sort type is
+set to \fIweighted\fP.
 
 .IP *FvwmIconMan: [id ]title \fItitlestring\fP
 Specifies the window title string for that manager window. \fITitlestring\fP
Index: modules/FvwmIconMan/FvwmIconMan.h
===
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconMan/FvwmIconMan.h,v
retrieving revision 1.39
diff -u -r1.39 FvwmIconMan.h
--- modules/FvwmIconMan/FvwmIconMan.h   2002/04/22 08:06:15 1.39
+++ modules/FvwmIconMan/FvwmIconMan.h   2002/04/25 07:25:19
@@ -266,9 +266,18 @@
   SortNone,  /* no sorting */
   SortId,/* sort by window id */
   SortName,  /* case insensitive name sorting */
-  SortNameCase   /* case sensitive name sorting */
+  SortNameCase,  /* case sensitive name sorting */
+  SortWeighted   /* custom sort order */
 } SortType;
 
+typedef struct {
+  char *resname;
+  char *classname;
+  char *titlename;
+  char *iconname;
+  int weight;
+} WeightedSort;
+
 typedef struct win_manager {
   unsigned int magic;
   int index;
@@ -300,6 +309,8 @@
   Uchar followFocus;
   Uchar usewinlist;
   SortType sort;
+  WeightedSort *weighted_sorts;
+  int weighted_sorts_len, weighted_sorts_size;
   char *AnimCommand;
   Uchar showonlyiconic;
   rectangle managed_g;/* dimensions of managed screen portion */
@@ -370,6 +381,7 @@
 
 extern void init_globals (void);
 extern int allocate_managers (int num);
+extern int expand_weighted_sorts (void);
 
 extern WinData *new_windata (void);
 extern void free_windata (WinData *p);
Index: modules/FvwmIconMan/globals.c
===
RCS file: /home/cvs/fvwm/fvwm/modules/FvwmIconMan/globals.c,v
retrieving revision 1.19
diff -u -r1.19 globals.c
--- modules/FvwmIconMan/globals.c   2002/04/23 01:26:54 1.19
+++ modules/FvwmIconMan/globals.c   2002/04/25 07:25:19
@@ -72,6 +72,9 @@
   globals.managers[id].dontshow.mask = ALL_NAME;
   globals.managers[id].usewinlist = 1;
   globals.managers[id].sort = SortName;
+  globals.managers[id].weighted_sorts = NULL;
+  globals.managers[id].weighted_sorts_len = 0;
+  globals.managers[id].weighted_sorts_size = 0;
   globals.managers[id].bindings[MOUSE] = ParseMouseEntry (DEFAULT_MOUSE);
   globals.managers[id].we_are_drawing = 1;
   globals.managers[id].showonlyiconic = 0;
Index: modules/FvwmIconMan/readconfig.c
===

Re: FvwmIconMan - custom sorting

2002-04-22 Thread Derek B. Noonburg
On 22 Apr, [EMAIL PROTECTED] wrote:
 On 20 Apr, Derek B. Noonburg wrote:
 
 I added support to FvwmIconMan for a custom sort type, so you can do
 stuff like this:
 
 *FvwmIconMan*sortcustom
 *FvwmIconMan*customsort  0 class=XTerm title=special
 *FvwmIconMan*customsort  1 class=XTerm
 *FvwmIconMan*customsort  2 class=Emacs title=hacking
 *FvwmIconMan*customsort  3 class=Emacs
 *FvwmIconMan*customsort  4 class=TkRat
 *FvwmIconMan*customsort  5 class=Mozilla-bin
 *FvwmIconMan*customsort  99
 
 Now xterm windows with the title special go at the top, followed by
 all other xterms, etc.  The customsort option supports resource, class,
 title, and icon (just like show/dontshow).
 
 Technically, wouldn't that be Weighted Sorting?  The numbers appear to
 be weights.

I guess weights is a reasonable term.  I was just calling them
indexes in the code.  I could change it to something like:

*FvwmIconMan*sort   weighted
*FvwmIconMan*sortweight 0 class=XTerm title=special
...

I'll grab the code from CVS as soon as I have time, and then post a
patch.

- Derek


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


FvwmIconMan - custom sorting

2002-04-20 Thread Derek B. Noonburg
I added support to FvwmIconMan for a custom sort type, so you can do
stuff like this:

*FvwmIconMan*sort   custom
*FvwmIconMan*customsort 0 class=XTerm title=special
*FvwmIconMan*customsort 1 class=XTerm
*FvwmIconMan*customsort 2 class=Emacs title=hacking
*FvwmIconMan*customsort 3 class=Emacs
*FvwmIconMan*customsort 4 class=TkRat
*FvwmIconMan*customsort 5 class=Mozilla-bin
*FvwmIconMan*customsort 99

Now xterm windows with the title special go at the top, followed by
all other xterms, etc.  The customsort option supports resource, class,
title, and icon (just like show/dontshow).

If this sounds useful, I'll be happy to post the patch.  (It's against
2.4.7, not 2.5.x - sorry.)

- Derek


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