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 707132 - gtkwindow: Allow removing titlebar all together
gtkwindow: Allow removing titlebar all together
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2013-08-30 14:48 UTC by Zeeshan Ali
Modified: 2013-10-01 00:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkwindow: Allow removing titlebar all together (1.25 KB, patch)
2013-08-30 14:48 UTC, Zeeshan Ali
needs-work Details | Review

Description Zeeshan Ali 2013-08-30 14:48:51 UTC
See patch
Comment 1 Zeeshan Ali 2013-08-30 14:48:53 UTC
Created attachment 253624 [details] [review]
gtkwindow: Allow removing titlebar all together

In certain specific cases, apps might want to not have any titlebar on
their windows and we should allow that. For example, Boxes needs to
display its own custom title bar even when fullscreen in certain
circumstances and needs to show/use the same titlebar when not in
fullscreen.
Comment 2 Emmanuele Bassi (:ebassi) 2013-08-30 14:56:38 UTC
Review of attachment 253624 [details] [review]:

this does not really work.

set_titlebar(NULL) should reset the state of the GtkWindow - i.e. it should be possible to roundtrip between set_titlebar(widget) and set_titlebar(NULL).

::: gtk/gtkwindow.c
@@ +3553,3 @@
 
+  if (titlebar == NULL)
+      return;

coding style: only two spaces.
Comment 3 Zeeshan Ali 2013-08-30 15:10:34 UTC
Review of attachment 253624 [details] [review]:

>set_titlebar(NULL) should reset the state of the GtkWindow - i.e. it should be possible to roundtrip between set_titlebar(widget) and set_titlebar(NULL).

it only returns after unset_titlebar(window) has been called and that should take care of getting rid of previous widget?
Comment 4 Emmanuele Bassi (:ebassi) 2013-08-30 15:28:25 UTC
Review of attachment 253624 [details] [review]:

you return after the custom_titlebar is set to TRUE, and the CSD support is enabled. also, unset_titlebar() only clears the pointers.

roundtrip means that set_titlebar(NULL) undoes everything that set_titlebar(widget) does.
Comment 5 Zeeshan Ali 2013-08-30 15:32:41 UTC
Review of attachment 253624 [details] [review]:

Ah ok, sorry my brain was too much into 'how to enable CSD in Boxes' issue. Thanks for explaining.
Comment 6 Matthias Clasen 2013-09-17 02:51:34 UTC
Under X, you can do something like

        gtk_widget_realize (window);
        gdk_window_set_decorations (gtk_widget_get_window (window),
                                    GDK_DECOR_BORDER);

Doesn't work with client-side decorations under Wayland, though...
Comment 7 Murray Cumming 2013-09-29 20:39:34 UTC
By the way, gtk_window_set_titlebar() doesn't even check for a NULL titlebar widget right now.