1

Is there any way I can detect (in a standard, non-hackish way) whether my Gnome app with a GtkHeaderBar is running under a window manager that provides its own window decorations (for example, XFWM) so that I can set gtk_header_bar_set_show_close_button to FALSE when it's not needed?

UPD: To be more clear, I want to hide GTK header buttons, not the WM ones.

NK22
  • 25
  • 4

1 Answers1

0

The support for client side decorations should come from a window manager itself or informations about the lack of it from environment. XFWM added support for them in version 4.12.

Oh wow, many commits, such features ! You can read the 4.11.3 announcement here

  • Client Side Decoration (CSD) support ! (Compositor need to be enabled). A screenshot with and without on gedit (an application that need CSD) CSD on xfwm4

Source: https://blog.alteroot.org/articles/2015-02-19/new-from-xfce-part-3.html

A screenshot with and without on gedit (an application that need CSD)

Moreover, GTK Headerbar should respect content of $GTK_CSD environmental variable and don't show the close button if set to 0 (Please mind that this variable can be not set if the CSDs are supported). As can be seen in Ubuntu.

Ubuntu Unity effect of chaning $GTK_CSD

This means it is something that should be covered for you but you can also try checking for content of $XDG_CURRENT_DESKTOP or read up on more hacky ways to extend support to more WMs and older systems: more in this stack overflow question.

morningbird
  • 210
  • 1
  • 11
  • Well, I guess I'll have to do it the hackish way. – NK22 Jun 20 '17 at 14:55
  • @NK22 There is no documented way of doing it. There are some issues about it but from the bug-tracker shows the patch was rejected. Maybe you can get more info on how some proposed to detect this: https://bugzilla.gnome.org/show_bug.cgi?id=729721 https://bugzilla.gnome.org/show_bug.cgi?id=729769 – morningbird Jun 21 '17 at 09:51