Ugly window decorations and how to fix them (GTK+ 3.12)

Added by John Lindgren 8 months ago

If you are using Audacious in an environment other than GNOME, and update GTK+ to version 3.12, you will notice that the title bars on dialog windows look GNOME-y and out of place. For example, you might see this if you are using OpenBox:

In XFCE, it is even worse. Dialog windows have two titlebars:

The new look is a result of GNOME (and GTK+ along with it) switching to client-side window decorations. "Client-side" means that each running program draws its own titlebar instead of letting the window manager draw it. As a result, the look and function of each program's titlebar will vary depending on which widget toolkit that program is using. The switch is an unfortunate design decision on the part of the GNOME developers, and runs contrary to established practice in the most widely used PC windowing systems (X11, Windows, and OS X).

There is currently no way around the non-standard titlebars other than patching GTK+. (A working patch for GTK+ 3.12 is attached to this post.) I personally hope that the GNOME developers will reconsider their decision and allow non-GNOME programs to use traditional dialog windows, as was possible in previous versions of GTK+. If not, we may consider porting Audacious to a different widget toolkit (probably Qt) in future.

Edit: And ... I totally posted the wrong patch. Fixed now.

gtkdialog.c.diff Magnifier (1.7 kB)


Replies (22)

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Q. P. 8 months ago

John Lindgren wrote:

I personally hope that the GNOME developers will reconsider their decision and allow non-GNOME programs to use traditional dialog windows, as was possible in previous versions of GTK+.

Did you file a bug for this on the GNOME bug tracker or something like that?

If yes: could you please post the link to it?

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 8 months ago

#727693 relates specifically to the double decorations under XFCE. That particular problem is caused by the limited support for Motif hints in xfwm4.

Regarding client-side decorations in general, that design decision has been discussed repeatedly on the GTK+ IRC channel. The developers know that they are making life difficult for non-GNOME software developers, but they consider us a "niche" audience and so do not see the need to provide first-class support. I doubt that further input from me will change that view. If enough other programs were using GTK+ 3.x instead of still using 2.x or switching to Qt as several have done recently, it might be a different story. As things stand, it is a vicious cycle where the lack of support drives developers away, while the lack of developers means there is little incentive to provide better support.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Thomas Lange 8 months ago

Why can we not use gtk_window_set_titlebar ((GtkWindow *) dialog, NULL)?
On Gnome3 it looks like before (as wanted) and on Xfce it shows only one titlebar.

https://developer.gnome.org/gtk3/stable/GtkWindow.html#gtk-window-set-titlebar

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 8 months ago

Thomas Lange wrote:

Why can we not use gtk_window_set_titlebar ((GtkWindow *) dialog, NULL)?

That would work for dialogs that we create directly. It would not work for dialogs that GTK+ creates itself: for example, the ones that pop up when you click on a GtkColorButton or GtkFileChooserButton (and we use both of those).

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Alister Hood 7 months ago

Fixed with version 3.12.1

Not in e.g. the plugin "about" dialogs. I couldn't find a GTK ticket for this - is there one?

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 7 months ago

Thomas Lange wrote:

Fixed with version 3.12.1.

Please confirm? I don't see any related changes between 3.12.0 and 3.12.1.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 7 months ago

I still see two titlebars here (in XFCE), as does the person who reported bug #727414 (in both KDE and XFCE).

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Anonymous 7 months ago

My 2 cents: Switching to Qt is not a bad idea.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 7 months ago

Henry Ducasse wrote:

My 2 cents: Switching to Qt is not a bad idea.

There has been some email discussion of this lately, and it is likely to become the long-term plan. Git master already has changes in place to remove the GTK+ dependency from Audacious core so that we can begin developing an Qt-based interface plugin alongside the existing GTK+ interfaces. Since Qt requires the use of C++, we are also considering switching completely to C++ (and taking advantage of some of its additional capabilities) rather than trying to maintain a codebase that is split between C++ and C.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Thomas Lange 7 months ago

John, do you use a compositor?
With the default compositor from Xfce (and GTK 3.12.1) only one titlebar is displayed.
Otherwise it looks like in your screenshot.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 7 months ago

I do not use a compositor. Regardless, I do not consider hiding the system titlebars a real fix, since dialog windows will still have a foreign look and behavior in any desktop environment other than GNOME.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Matti Hämäläinen 6 months ago

This patch I made for Gtk+ 3.12.2 might be of some interest to other people too, as it addresses the CSD and "headerbar" issue more thoroughly, and is togglable via a environment variable .. so throwing it out here as well:

http://tnsp.org/~ccr/gtk3/gtk3_disable_csd_envvar_20140527.diff

The patch is described in the Debian bugreport below:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=744249#25

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Harri Bert 5 months ago

It seems as if this problem is going to be fixed in a more generic way:
https://bugzilla.gnome.org/show_bug.cgi?id=729721

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren 5 months ago

Harri Bert wrote:

It seems as if this problem is going to be fixed in a more generic way:
https://bugzilla.gnome.org/show_bug.cgi?id=729721

I doubt it. Did you notice that no GTK+ developer has touched that bug report in over a month, and that the last comment is "What's the state of this?"

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Jen Yee Hong 3 months ago

Try this hack:
https://github.com/PCMan/gtk3-nocsd
I developed a fix to turn it off with LD_PRELOAD.
This works with gtk+ 3.12 and is very selective.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Alister Hood about 1 month ago

If I use gtk3-nocsd I get both the header bar and a title bar provided by my window manager (Openbox), but unlike the XFCE screenshot it has the action buttons in the header bar instead of at the bottom of the window.

If I also use this /etc/gtk-3.0/settings.ini file then the action buttons are at the bottom of the window, but I still have both bars, like in the XFCE screenshot:

[Settings]
gtk-dialogs-use-header=false

This is with an unpatched gtk+ 3.12.1
gtk3-nocsd doesn't required 3.12.2, or a patch or anything, does it?

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by Alister Hood about 1 month ago

Sorry, scratch that about the action buttons in the header bar. It was only because I had been playing with a settings.ini
So, with an unpatched gtk+ 3.12.1, gtk3-nocsd just gives me the WM title bar in addition to the header bar.

RE: Ugly window decorations and how to fix them (GTK+ 3.12) - Added by John Lindgren about 1 month ago

GTK+ 3.14 has a more complete fix, which restores traditional title bars and button positions outside GNOME. If there's nothing preventing you from updating, then that would be your best option. (Or use Audacious from Git master which is now GTK2-based.)

(1-22/22)