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 782117 - If a window was initially shown undecorated and set_decorated(True) is called, titlebar is drawn inside the window
If a window was initially shown undecorated and set_decorated(True) is called...
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other Linux
: Normal minor
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-05-03 11:13 UTC by Christian Stadelmann
Modified: 2017-05-22 07:57 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
A demo python3 script (2.00 KB, text/x-python)
2017-05-03 11:13 UTC, Christian Stadelmann
  Details
A screenshot of the window on wayland after reproducing the bug (2.58 KB, image/png)
2017-05-03 11:14 UTC, Christian Stadelmann
  Details
[PATCH] gtkwindow: Hide CSD title bar when undecorated (919 bytes, patch)
2017-05-03 12:31 UTC, Olivier Fourdan
committed Details | Review

Description Christian Stadelmann 2017-05-03 11:13:00 UTC
Created attachment 350963 [details]
A demo python3 script

Steps to reproduce:
0. on a GNOME/Wayland session,
1. create a window with decorations
2. show the window
3. unset the decorations using gtk_window_set_decorated(window, false)

What happens:
The window messes up, drawing the titlebar way inside the window.

What should happen:
Do not draw the titlebar inside the window.

Affected version:
gtk3-3.22.12-2.fc25.x86_64

Additional info:
This issue is not present on x11 with GDK_BACKEND=x11 enforced on a GNOME/Wayland session.

I know that the documentation specifies that unsetting the decoration may fail, but since Gtk+ on Wayland uses client-side decorations, there is no window manager to blame.

To reproduce, simply run the attached python script with
> python3 test_window_decoration_on_wayland.py

inside a GNOME/wayland session. If you run it with
> GDK_BACKEND=x11 python3 test_window_decoration_on_wayland.py

instead, it will work fine.
Comment 1 Christian Stadelmann 2017-05-03 11:14:25 UTC
Created attachment 350964 [details]
A screenshot of the window on wayland after reproducing the bug
Comment 2 Olivier Fourdan 2017-05-03 12:02:27 UTC
But it's not Wayland backend, it's gtk+ CSD code, the exact same issue occurs with "GDK_BACKEND=x11 GTK_CSD=1 python test_window_decoration.py" as well :)
Comment 3 Christian Stadelmann 2017-05-03 12:04:04 UTC
(In reply to Olivier Fourdan from comment #2)
> But it's not Wayland backend, it's gtk+ CSD code, the exact same issue
> occurs with "GDK_BACKEND=x11 GTK_CSD=1 python test_window_decoration.py" as
> well :)

Oops, nice catch, thanks for the correction.
Comment 4 Olivier Fourdan 2017-05-03 12:31:52 UTC
Created attachment 350970 [details] [review]
[PATCH] gtkwindow: Hide CSD title bar when undecorated

When switching from decorated to undecorated, the title bar should be
hidden as well.
Comment 6 Olivier Fourdan 2017-05-22 07:57:06 UTC
Comment on attachment 350970 [details] [review]
[PATCH] gtkwindow: Hide CSD title bar when undecorated

attachment 350970 [details] [review] pushed to branch gtk-3-22 as commit 5209995 - gtkwindow: Hide CSD title bar when undecorated