After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 757690 - [Wayland] gtk_window_resize() does not behave as expected
[Wayland] gtk_window_resize() does not behave as expected
Status: RESOLVED DUPLICATE of bug 756618
Product: gtk+
Classification: Platform
Component: Backend: Wayland
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-11-06 15:28 UTC by Eric Williams
Modified: 2015-11-16 16:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
GTK snippet with gtk_window_resize() (653 bytes, text/x-csrc)
2015-11-06 15:28 UTC, Eric Williams
Details
GTK2 vs GTK3 (Wayland) (9.87 KB, image/png)
2015-11-06 15:30 UTC, Eric Williams
Details
GTK3 X11 vs GTK3 Wayland (36.83 KB, image/png)
2015-11-06 15:30 UTC, Eric Williams
Details
Updated example (653 bytes, text/plain)
2015-11-16 14:11 UTC, Olivier Fourdan
Details

Description Eric Williams 2015-11-06 15:28:49 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.
Comment 1 Eric Williams 2015-11-06 15:30:01 UTC
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.
Comment 2 Eric Williams 2015-11-06 15:30:59 UTC
Created attachment 315002 [details]
GTK3 X11 vs GTK3 Wayland

A screenshot showing the difference in size between GTK3 with X11 and GTK3 with Wayland.
Comment 3 Eric Williams 2015-11-06 15:33:58 UTC
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
Comment 4 Christian Stadelmann 2015-11-13 19:01:31 UTC
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
Comment 5 Olivier Fourdan 2015-11-16 14:11:50 UTC
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.
Comment 6 Eric Williams 2015-11-16 16:36:41 UTC
(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 ***