Re: FVWM: windows move across restart [fixed]

From: Gregory Margo <gmargo_at_newton.vip.best.com>
Date: Mon, 11 Dec 1995 12:21:06 -0800 (PST)

Since it seems that no one has reproduced the bug I was seeing, here
is both an improved procedure for seeing the problem, and the fix.

Please try this out if you are so inclined. It would be nice if someone
was able to reproduce the problem and verify that the patch fixes it.

To recap: Any window that fvwm places with SmartPlacement and
RandomPlacement will exhibit this behavior: when fvwm is first restarted
after window creation, that window will move slightly.


How to reproduce the "Windows Move Across Restart" bug.

1. Create simple demonstration control files (.xinitrc and .fvwm2rc)

   a. .xinitrc contents:

      #!/bin/sh
      fvwm2 &
      # sleep to be sure fvwm starts before xterm starts
      sleep 2
      exec xterm -C -title CONSOLE

   b. ~/.fvwm2rc contents:

      Create ~/.fvwm2rc from the default system.fvwmrc and change the
      "ActivePlacement" style default to "RandomPlacement". [And other
      changes as needed for ModulePath or fvwm filename differences.]

2. Start X

3. The "CONSOLE" xterm should be placed at geometry 80x24+1+1.
   Use both xwininfo and FvwmIndent to verify.

4. Restart fvwm from the menu.

5. The "CONSOLE" xterm should have moved to geometry 80x24+0+0.
   Both xwininfo and FvwmIdent should agree.


This "-1,-1" translation is a bug in the placement code that occurs
only if the window is placed with RandomPlacement/SmartPlacement,
and then fvwm is restarted.

The following patch fixes the problem. The x,y and xdiff,ydiff values
will be recorded similar to the ActivePlacement/SmartPlacement code.

--- fvwm-2.0.39/fvwm/placement.c Mon Apr 24 11:14:08 1995
+++ fvwm2-new/fvwm/placement.c Mon Dec 11 11:41:37 1995
_at_@ -185,13 +185,13 @@
                 Scr.randomx = Scr.TitleHeight;
               if ((Scr.randomy += 2*Scr.TitleHeight) > Scr.MyDisplayHeight / 2)
                 Scr.randomy = 2 * Scr.TitleHeight;
- tmp_win->attr.x = Scr.randomx - tmp_win->old_bw;
- tmp_win->attr.y = Scr.randomy - tmp_win->old_bw;
+ tmp_win->attr.x = Scr.randomx - tmp_win->old_bw + tmp_win->bw;
+ tmp_win->attr.y = Scr.randomy - tmp_win->old_bw + tmp_win->bw;
             }
           else
             {
- tmp_win->attr.x = xl - tmp_win->old_bw;
- tmp_win->attr.y = yt - tmp_win->old_bw;
+ tmp_win->attr.x = xl - tmp_win->old_bw + tmp_win->bw;
+ tmp_win->attr.y = yt - tmp_win->old_bw + tmp_win->bw;
             }
           /* patches 11/93 to try to keep the window on the
            * screen */
_at_@ -214,8 +214,8 @@
               Scr.randomy = 0;
             }
 
- tmp_win->xdiff = tmp_win->attr.x - tmp_win->bw;
- tmp_win->ydiff = tmp_win->attr.y - tmp_win->bw;
+ tmp_win->xdiff = tmp_win->attr.x + tmp_win->old_bw - tmp_win->bw;
+ tmp_win->ydiff = tmp_win->attr.y + tmp_win->old_bw - tmp_win->bw;
         }
       else
         {



Please let me know if you can exhibit the problem, if the patch works,
if I'm totally out of my mind, or if your sister is single :-)

In case it matters, this is my environment:
Linux-1.2.13
GCC-2.7.0
Libc-5.0.9
XFree86-3.1.2-elf
Screen set to 1024x768, 256 colors.

thanks,
gm
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Gregory H. Margo No free speech restrictions on the Internet!
gmargo_at_newton.vip.best.com
--
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Dec 11 1995 - 14:21:22 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:57 BST