Subject: FVWM: Bug in gridded window resize generated by application

From: Raphael Finkel <[email-masked]>
Date: Mon, 8 Jul 1996 10:33:20 -0400 (EDT)

There is a bug in the interaction of Tk4.1 and fvwm2.  I am
cross-posting this note to both lists: [email-masked] and comp.lang.tcl.

When Tk resizes a window whose natural size changes, and the window has
gridding on, it may select a size that is not a multiple of the grid
size.  For example, the window may contain a frame around a text
widget.  The text widget size will be an integral multiple of grid
size, but the frame around it may increase the size by some other
amount.

When fvwm2 gets the Property Notify event (file events.c, procedure
HandlePropertyNotify(), case XA_WM_NORMAL_HINTS), it calls
ConstrainSize() to force the window to a size it considers reasonable.
Among other constraints (such as not being outside the viewable window
or smaller than a minimum), this procedure requires that gridded
windows be a multiple of the grid size.  It reduces the size to fit.
This problem did not exist in fvwm.

The result is that Tk receives an unexpected window size change, and
interprets as a user-generated size request.  Tk then changes the
policy on the window from "natural" sizing to "interactive" resizing,
which confuses further changes to window size.

The fix for this from the fvwm2 side, I think, is to remove the call to
ConstrainSize() in this case of HandlePropertyNotify().  If an
application chooses to modify its own properties, it is perhaps not the
window manager's prerogative to adjust those modifications.  I have
modified my copy of fvwm2 this way, and it seems to fix the problem
without introducing other problems.

The fix from the Tk side is to expect spurious ConfigureNotify
responses from an internally generated natural size change and to
ignore them.  However, it is difficult to distinguish such spurious
responses from legitimate user-initiated size changes.  I don't know
how to insert such a fix.

I do not belong to the fvwm mailing list, nor do I generally read the Tcl
newsgroup, so I would appreciate direct responses by e-mail.

Raphael Finkel
[email-masked]
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to [email-masked].
To report problems, send mail to [email-masked].