Subject: bug#19990: 24.4; Bad resizing interaction when WM ignores size hints

From: martin rudalics <[email-masked]>
Date: Fri, 06 Mar 2015 19:54:33 +0100

> I should have never said 'full screen height', since this keeps
 > confusing you. In my particular configuration, I have no window borders,
 > so two windows side-by-side will automatically fit the screen height.
 > This is *not* a special case for a tiling window manger.
 >
 > A tiling window manager will force the frame to fit a screen region,
 > _possibly_ ignoring size hints. That's all there is to it. It does that
 > *intentionally*, since you can imagine that having gaps between the
 > tiles is just plainly annoying. In a side-by-side configuration, you
 > don't want gaps on the lower corner of the screen.

Accepted.  The frame is not fullheight; it just is as high as the screen.

 > The second issue with Gtk+ is that it notifies the application while
 > doing his own hint handling (or again, is that intentional?).
 >
 > I would be perfectly happy to discuss this issue with Gtk+ folks, but I
 > remember that back in Gtk 1.3/2.0 days, many of my patches where
 > rejected since they fixed behavior that wasn't really intended "for the
 > common user", whatever that means. Gtk 3 seems to have regressed even
 > more in this area, so I just gave up in trying to argue.
 >
 > To sum up, however, what about this:
 >
 > Since we receive the first ConfigureNotify event with the unhinted
 > width/height, we *can* detect that the size hints have been ignored.
 > Couldn't we disable them at that point?

This was the idea of "intercepting" I mentioned earlier.

 > This would fix Gtk+ trying to do
 > a reconfiguration attempt and remove the following two useless events.
 > This looks like a simple fix that would already improve the current
 > configuration, but I would need experience with the Mac/Win port to tell
 > if Gtk would fail in this scenario. Maybe an "ifdef X11" is required.

You can ignore other ports in this regard.

 > The question then becomes: would actually be possible to set the hints
 > immediately back on, so that in a further resize request the WM sees the
 > hints, but *without* having Gtk+ do it's mess? This would mean that we
 > would need to set the hints back on when the resize request has been
 > fully settled. Tricky. Setting them back-on on a further repaint/focus
 > in/out event is either too late or not enough.

I'm afraid this is the hard part. Emacs would have to know that the
window manager has stopped tiling.  I already said that GtkWindowPrivate
has a `tiled' entry.  I have no idea who can use or set that.

 > As mentioned in my first request, this is a minor nuance fix for folks
 > with tiling window managers. My point is "can we handle it better?".

martin