Subject: [patch] focus warping bug in 2.0.46

From: [email-masked] (Greg Klanderman)
Date: Wed, 8 Apr 1998 20:51:52 -0400 (EDT)

Hello,

The patch below seems to be needed to avoid invalid icon location
fields from being used when focusing to an iconified window which has
no icon window (using FvwmIconMan).  I also fixed an apparent typo
(width/height were swapped), I'm not sure the consequences of that.
I'm still not sure why you'd ever want to call SetupFrame (last line
of context in the patch).

The bug manifests itself if you create a window in one part of a desk,
and move it to a different part of the viewport.  Iconify it, putting
it into FvwmIconMan.  Now, if you have IconMan set as follows, and you
move the mouse over the button for that window, selecting it, the
viewport warps to 0,0 and the window is moved to 0,0.

Let me know if you need more information,
Greg

Style "Fvwm*"       NoTitle, Sticky, WindowListSkip
Style "Fvwm*"       BorderWidth 2, CirculateSkipIcon, CirculateSkip
Style "FvwmIconMan" Title, CirculateHit

*FvwmIconMan*action          Select sendcommand Focus
*FvwmIconMan*resolution      page
*FvwmIconMan*usewinlist      true
*FvwmIconMan*drawicons       true
*FvwmIconMan*followfocus     true
*FvwmIconMan*sort            true
*FvwmIconMan*managergeometry -1+1
*FvwmIconMan*buttongeometry  90x19
*FvwmIconMan*font            -adobe-helvetica-bold-r-normal--10-*
*FvwmIconMan*background           dimgray
*FvwmIconMan*foreground           white
*FvwmIconMan*plainbutton          up
*FvwmIconMan*selectbutton         down
*FvwmIconMan*focusbutton          raisededge white palevioletred
*FvwmIconMan*focusandselectButton raisededge white palevioletred

--- ../.backups/builtins.c!!!proj!mstar!software!fvwm!fvwm-2.0.46!fvwm!.~1~	Tue Aug 19 19:41:27 1997
+++ fvwm/builtins.c	Wed Apr  8 20:36:56 1998
@@ -180,6 +180,7 @@
   }
 
 #ifndef NON_VIRTUAL
+  if (!(t->flags & ICONIFIED) || t->icon_w) {
   if(t->flags & ICONIFIED)
   {
     cx = t->icon_xl_loc + t->icon_w_width/2;
@@ -195,6 +196,7 @@
   dy = (cy +Scr.Vy)/Scr.MyDisplayHeight*Scr.MyDisplayHeight;
 
   MoveViewport(dx,dy,True);
+  }
 #endif
 
   if(t->flags & ICONIFIED)
@@ -217,7 +219,7 @@
   KeepOnTop();
 
   /* If the window is still not visible, make it visible! */
-  if(((t->frame_x + t->frame_height)< 0)||(t->frame_y + t->frame_width < 0)||
+  if(((t->frame_x + t->frame_width)< 0)||(t->frame_y + t->frame_height < 0)||
      (t->frame_x >Scr.MyDisplayWidth)||(t->frame_y>Scr.MyDisplayHeight))
   {
     SetupFrame(t,0,0,t->frame_width, t->frame_height,False);
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].