GNOME Bugzilla – Bug 707132
gtkwindow: Allow removing titlebar all together
Last modified: 2013-10-01 00:19:53 UTC
See patch
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.
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.
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?
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.
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.
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...
By the way, gtk_window_set_titlebar() doesn't even check for a NULL titlebar widget right now.