Subject: bug#23144: closed (Re: shrinking windows with gtk 3.20)

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 16 May 2016 17:12:02 +0000

Your bug report

#23144: shrinking windows with gtk 3.20

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
23144: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=23144
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: shrinking windows with gtk 3.20
From: Paul Eggert <[email-masked]>
To: Eli Zaretskii <[email-masked]>
Cc: [email-masked], [email-masked], [email-masked]
Date: Mon, 16 May 2016 10:11:48 -0700
List-Id: <debbugs-submit.debbugs.gnu.org>

On 05/16/2016 08:53 AM, Eli Zaretskii wrote:
> we could reject GTK+ 3.20.4 and later for Emacs 25.1 at configure
> time.

On further investigation of the Gtk+ source, it appears that the Gtk+ 
change went in at release 3.20.3. Since it seems clear that Emacs has 
serious problems in 3.20.3 or later because of the call to 
xg_frame_resized, I installed the attached patch and am boldly closing 
the bug report. Quite possibly there is a better way to fix the bug but 
I hope this is good enough to get by.

Subject: shrinking windows with gtk 3.20
From: Matthias Clasen <[email-masked]>
To: [email-masked]
Date: Mon, 28 Mar 2016 16:52:47 -0400
List-Id: <debbugs-submit.debbugs.gnu.org>

We've observed that after

https://git.gnome.org/browse/gtk+/commit/?id=67ab00e01ec06d7b05a82c3d80b235ac6c4abfd2

emacs windows shrink to a small height, after initially appearing with
the expected size. For that reason, I have reverted to commit in the
stable gtk 3.20 branch.

But after looking a bit closer, I find that what emacs does is really
unsupportable: It handles X events behind GTK+'s back, and upon seeing
a map notify, it calls xg_frame_resized with -1, -1 for width and
height, which makes it call gdk_window_get_geometry to obtain the
current size. But at that point (before GTK+ has handled the map
notify), the function still returns the initial values of 1, 1, which
then leads eventually to a call of gtk_window_resize() with the small
height that we're seeing the window shrink to.

Therefore, I will bring back the reverted change in GTK+ master.

Possible workarounds/fixes in the emacs code:

1) Recognize when gdk_window_get_geometry returns the initial size
(1,1) and silently return as if the window was unmapped.

2) Just drop the xg_frame_resized call on MapNotify. Omitting it
doesn't have any noticeable negative consequences.