Time to use header bars in Unity?

My employer, Igalia, recently purchased a Gazelle Pro from System76 for me to use. So far, it seems like a great laptop, but time will tell. It came with Ubuntu 15.04 preinstalled, so before replacing that with Fedora Workstation, I decided to check out how some of our applications look under Ambiance, the GTK+ theme that Ubuntu uses instead of Adwaita.

For the most part, Ambiance looks great. The overlay scrollbars leave much to be desired compared to upstream’s, but that’s my only real complaint. I found that Ambiance makes better use of space in general, using much less padding than Adwaita to fit significantly more content into application windows. (This is the reason behind complaints that “everything is bigger” in GNOME.) On the whole, that seems like a big advantage over Adwaita to me, though I’m concerned that might make it harder to use a touchscreen.

But I found some of the applications I maintain did not look so great, due to no fault of Ambiance, but to some non-ideal use of GtkHeaderBar.

When we started using GtkHeaderBars to replace system title bars a couple years ago, many GTK+ themes needed some time to catch up, as they were suddenly responsible for themeing title bars to look similar to the window manager’s title bars. One disadvantage of this is that it’s no longer possible to mix-and-match GTK+ themes with different window manager themes and get a good result, but if the GTK+ theme matches the window manager’s theme, there is no problem.

This approach worked well enough for us with most distributions, but Ubuntu, rather than improving their theme (which is not easy work, to be sure) and using the provided settings to put the proper window decorations in the right place, started patching our applications to set the header bars as the title bars only in GNOME. These patches took various forms: in some cases, like Calculator, the header bar was removed and its contents replaced with a menu bar (a strategy I dislike: we’ve been getting rid of menu bars because they are difficult to use), but generally the header bar was kept and simply packed underneath the title bar, instead of replacing the title bar. Since this made things worse in environments with updated themes that used the new window decoration settings, I decided to start accepting these patches upstream (in most cases), but tweaked so that the header bar would be used as the title bar in all desktops except Unity, rather than only in GNOME.

The problem is, Ubuntu’s handling of header bars as title bars has since improved considerably, and it seems applications look better now with the header bars used as title bars than with the header bars underneath the title bars. Compare Font Viewer (which uses a header bar as the title bar) to Disks and Sudoku (which pack the header bar underneath the title bar, but only when running in Unity):

Disks and Sudoku pack header bars underneath the title bar when running in Unity. Font Viewer sets the header bar as the title bar unconditionally.
Disks and Sudoku pack header bars underneath the title bar when running in Unity. Font Viewer sets the header bar as the title bar unconditionally. Which looks better?

Seems to me that Font Viewer is looking much nicer than Disks and Sudoku. Sudoku is also suffering from redundancy, since the application title is included in both the title bar and the header bar. That’s fixable, but since this is a non-default configuration that developers never test, similar problems are just going to return.

The same applications running under GNOME. (Look at Disks to see how Ambiance uses less space than Adwaita, though it's more noticeable in other applications.)
The same applications running under GNOME. (Look at Disks to see how Ambiance uses less space than Adwaita, though it’s more noticeable in other applications.)

So my inclination is to drop our special handling of Unity. Ubuntu might patch it back in — it is free software, after all — but maybe not, and in any case I’d feel better about the code we have upstream. Which approach looks better to you?

11 Replies to “Time to use header bars in Unity?”

  1. Third option: Use header bars as title in normal window mode, but use header bar underneath the title bar when windows are normalize maximized mode. Otherwise you’ll end with duplicate window controls which just looks totally broken.

    1. Oh dear, I forgot about that problem because I didn’t test maximized apps this time (the Gazelle Pro has a nice screen, and maximized is very big), but I remember seeing that issue in the past.

      I think a better solution would be to add a GTK+ setting to suppress the window decorations in the header bar when the window is maximized. That seems reasonable, since there’s a popular desktop environment that really needs that behavior. I won’t put this on my to-do list, but it seems like an easy hack.

    1. Ubuntu does patch in full menu bars — completely removing the header bars — for some apps, but for other apps, it leaves the header bar intact, just not set as the title bar. The former style is not our problem, because these menus already do not exist upstream, except for a couple of rare exceptions (Calculator, gedit). The later style — no menu bar, with the header bar retained underneath the title bar — is more common upstream, at least in the projects I work with. Here there’s no menu bar to remove: it’s just a question of which looks better.

  2. Gnome applications should start to respect the environment they run under, i.e. those header bars in Gnome and its forks only.

    And why does Unity get special treatment but Gnome apps under Plasma work like crap?

  3. The problem with using header-bar under title-bar is that there will be no global menu for unity (unless patched) and thus preventing users from accessing app-preference for many Gnome-Apps (ex: eog).

    Gnome-Shell app menu is a failed concept for me. Gnome should try something like LIM from Ubuntu. That way both Gnome and non-Gnome apps can use it. And Ubuntu can convert it to horizontal menu and can retain both upstream headerbar & global menu.

    It may cause duplication of menus…but it is much than the nightmare situation they are in now.

  4. Hahaha, I had a quick look and planet.gnome.org to see what’s going on in the GNOME world and I see this silliness is still happening… Good luck continuing on your quest to force tablet interfaces on computer users…

  5. The unity 7 handling of title and header-bars is the main reason I use unity and not gnome. Also I prefer to have a classic menu bar with File, Edit, View, etc.. instead of to single button in gnome.
    I also haven’t understood the reasoning of gnome to remove the title-bar and then make the header-bar twice as thick.

  6. What GNOME is missing is keyboard only, mouseless human interaction with apps, which Ubuntu is handling nicely by HUD. I think it is actually fixing up GNOME apps by patching them

Comments are closed.