GNOME Bugzilla – Bug 757690
[Wayland] gtk_window_resize() does not behave as expected
Last modified: 2015-11-16 16:36:41 UTC
Created attachment 315000 [details] GTK snippet with gtk_window_resize() Using Wayland, calls to gtk_window_resize() do not behave as expected. The window ends up being smaller in size than the size specified. For example, I have attached a snippet that creates a window with a label inside it. The window is resized to 400x400 using gtk_window_resize(GTK_WINDOW(window), 400, 400). On X11, the window is 400x400 pixels, but on Wayland it's noticeably smaller. I can reproduce this bug on GTK3.18, and it occurred on GTK3.16 too. This is with Fedora 23/22.
Created attachment 315001 [details] GTK2 vs GTK3 (Wayland) This screenshot shows the difference between the same window on GTK2 and on GTK3 with the Wayland backend.
Created attachment 315002 [details] GTK3 X11 vs GTK3 Wayland A screenshot showing the difference in size between GTK3 with X11 and GTK3 with Wayland.
This bug seems to cause some layout problems in Eclipse with Wayland, mainly resulting in buttons and controls being cut off: https://bugs.eclipse.org/bugs/show_bug.cgi?id=481010 and https://bugzilla.redhat.com/show_bug.cgi?id=1255007
This bug seems to cause the same layout problems as referred to above for LibreOffice. See https://bugzilla.redhat.com/show_bug.cgi?id=1281906
Created attachment 315674 [details] Updated example I think this is indeed the same as bug 756618, basically, gtk_window_resize() takes the client side decorations into account and therefore ends up with a smaller window that expected. The attached (modified) version gives expected results with gtk+-3.19.x, the changes in the source code (i.e. moving the gtk_window_resize() after the gtk_window_show_all()) are necessary so that the size of the header bar and shadows are known at the time the resize is issued so that gtk_window_resize() can compensate for those additional controls.
(In reply to Olivier Fourdan from comment #5) > I think this is indeed the same as bug 756618, basically, > gtk_window_resize() takes the client side decorations into account and > therefore ends up with a smaller window that expected. > > The attached (modified) version gives expected results with gtk+-3.19.x, the > changes in the source code (i.e. moving the gtk_window_resize() after the > gtk_window_show_all()) are necessary so that the size of the header bar and > shadows are known at the time the resize is issued so that > gtk_window_resize() can compensate for those additional controls. Your snippet combined with the patch from bug 756618 fixes the problem for me on GTK3. Marking as a duplicate. *** This bug has been marked as a duplicate of bug 756618 ***