Hi,

playing around with FvwmProxy, I discovered that the proxied window only
moved right- and down-wards when dragging the proxy window.
The move commands sent by FvwmProxy for dragging left- and upwards are
of the form (from a log file of my login manager 'slim'):
07:14:51      1 [fvwm][LOG]: M: Move w+-5p w+-2p
and rejected by the code in fvwm/move_resize.c.

The attached patch provides a fix (one can infer from the manual that
'Move w+-5p w+-2p' should be valid).

Regards -- Gerard

Index: ChangeLog
===================================================================
RCS file: /home/cvs/fvwm/fvwm/ChangeLog,v
retrieving revision 1.3129
diff -u -r1.3129 ChangeLog
--- ChangeLog   9 Aug 2010 12:54:42 -0000       1.3129
+++ ChangeLog   31 Aug 2010 05:56:39 -0000
@@ -1,3 +1,7 @@
+2010-08-31  Gerard Vermeulen <gav...@gmail.org>
+       * fvwm/move_resize.c (GetOnePositionArgument):
+       Parse commands like 'Move w+-5p w+-2p' as generated by FvwmProxy.
+
 2010-08-09  Thomas Adam <tho...@xteddy.org>
        * NEWS:
        * configure.ac:
Index: fvwm/move_resize.c
===================================================================
RCS file: /home/cvs/fvwm/fvwm/fvwm/move_resize.c,v
retrieving revision 1.307
diff -u -r1.307 move_resize.c
--- fvwm/move_resize.c  28 Feb 2010 01:11:37 -0000      1.307
+++ fvwm/move_resize.c  31 Aug 2010 05:56:41 -0000
@@ -401,7 +401,19 @@
                float f;
 
                /* parse value */
-               if (sscanf(s1, "%d%n", &val, &n) < 1)
+               if (sscanf(s1, "-%d%n", &val, &n) >= 1)
+               {
+                       /* i.e. -1, -+1 or --1 */
+                       final_pos += (screen_size - window_size);
+                       val = -val;
+               }
+               else if (
+                       sscanf(s1, "+%d%n", &val, &n) >= 1 ||
+                       sscanf(s1, "%d%n", &val, &n) >= 1)
+               {
+                       /* i.e. 1, +1, ++1 or +-1 */
+               }
+               else
                {
                        /* syntax error, ignore rest of string */
                        break;

Reply via email to