Better Integration of Apps with Legacy Window Decorations

Problem

Despite header bars being available for years, there are still a large number of popular third-party apps that do not use them, either because they are not GTK3 apps, or because they haven't been updated to support them yet. These apps therefore have GTK2-style title bars that contain only the title and a close button, and can be used for moving the window. This is much less space-efficient than header bars, especially for applications that are usually used in full-screen, like browsers or productivity apps.

inkscape with legacy title bar blender with legacy title bar

On laptop screens, the space taken up by the title bar can be considerable. On a 1366x768px display, a 35px title bar takes up close to 5% of the entire screen.

Applicatons affected by this include:

  • GNOME Terminal
  • LibreOffice

  • Firefox (header bar support is being worked on)
  • Chromium (header bar support is being worked on)
  • Transmission
  • Telegram
  • Gimp
  • Inkscape
  • Blender
  • MyPaint

  • Krita
  • Atom
  • Visual Studio Code
  • Android Studio/IntelliJ
  • Slack
  • Skype
  • All other Qt, GTK2 and Electron apps

Potential Solutions

Solving this problem requires addressing two separate issues:

  1. Since many of the affected applications are not written in native GTK, in order for them to gain header bars, there would have to be an API for them to implement header bars in the way GNOME uses them (e.g. respecting the user's settings with regard to window controls). This would likely require working with the maintainers of other toolkits, or providing libraries for these toolkits that implement headerbars in the GNOME style.
  2. Even if there were a way for these third-party apps to get CSD, many applications are not likely to be updated/rewritten to inlcude header bars anytime soon. Therefore, it would be good to have a backup solution that doesn't require applications to be changed.

1. GNOME-style CSD for other toolkits

Affected toolkits include:

  • Qt
  • Electron

Individual apps with custom toolkits:

2. A fallback solution for legacy apps

Since 1) will take time and might not succeed in every case, we need a fallback that works now, and allows us to use apps with legacy decorations without having their decorations take up screen real estate all the time.

One very simple solution that currently works (only on X) for most apps is to use _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED to simply hide title bars completely when windows are full-screen or tiled. This is how extensions like Pixel Saver currently work. However, this does not work on Wayland [1], and it's not a very scalable solution, as window title and controls become completely invisible, which is hacky and potentially confusing.

A better solution could be to hide the window decorations behind the shell top bar and reveal them by moving down the entire window when the cursor hovers over the top bar. This would make them more accessible and discoverable, but might be annoying when it is triggered accidentally while clicking buttons close to the top bar. This would be similar to the behavior of the system top bar on macOS when apps are in fullscreen mode (it hides and slides in from the top if the cursor hits the top of the screen).

Another possible solution is to move title and close button to the shell top bar. Since app menus are going away, the left side could be used for the window title. The extension Status Title Bar does this already.

titlebar-hidden.png

[1] https://bugzilla.gnome.org/show_bug.cgi?id=775061

Design/Whiteboards/LegacyWindowDecorations (last edited 2017-10-20 10:32:50 by TobiasBernard)