0

I've just upgraded my GNOME to 3.24 and I'm finding that previous theme-hacking tricks for eliminating server-side window titlebars are no longer working. I would like to eliminate them because I think they take up too much space and provide no value (it's just a window title and close button, who needs that? I use keyboard shortcuts for closing windows anyway).

To be clear, the new-style headerbars with tools & titles integrated are quite nice and I don't want to touch those. Only "legacy" titlebars that are drawn by the window manager instead of the app must go.

GTK offers some significant customization with CSS and I've found many people discussing shrinking titlebars but it seems nobody knows how to eliminate titlebars. Here's what I've tried so far, in ~/.config/gtk-3.0/gtk.css:

.default-decoration,
.default-decoration *,
.default-decoration * *,
.default-decoration * * *,
.default-decoration * * * *,
window.ssd,
window.ssd *,
window.ssd * *,
window.ssd * * *,
window.ssd * * * * {
    min-height: 0px;
    min-width: 0px;
    padding: 0px;
    padding-top: 0px;
    padding-bottom: 0px;
    margin: 0px;
    margin-top: 0px;
    margin-bottom: 0px;
    border: 0px;
    background-color: #ff0000;
    font-size: 0px;
    opacity: 0;
    color: #00ff00;
}

/*  not a valid property name
max-height: 0;
max-width: 0px;
height: 0px;
width: 0px;
display: none;
overflow: hidden;
position: absolute;
top: -1000;
left: -1000;
*/

screenshot of above gtk.css

You can see here "green on red" titlebars are what I'm trying to remove. The coloring proves that the CSS selectors are targetting the correct widgets but there seems to be no way to tell gtk.css "hide this".

The commented out section are things that I tried that just spewed error messages on the console, the rest is just silently failing to achieve my goals.

For some reason opacity: 0 even only applies to the gnome-terminal window and not the others, but just makes the titlebar black.

Any help is appreciated, thanks.

robru
  • 2,313
  • 2
  • 29
  • 38

1 Answers1

1

Note: this applies to X11 only, as on Wayland all decorations come from the client.

Server side decorations are managed by the window manager, not by GTK+. At most, GTK+ provides styling classes for window managers like Metacity or GNOME Shell to render the server side decorations using the same style as client-side ones.

Additionally, GTK+ does not allow controlling the visibility or layout of the widgets via CSS, as that would break UIs with different themes.

You will need to modify the window manager you are using to remove the decorations.

ebassi
  • 8,648
  • 27
  • 29
  • Ok, so I'm using GNOME Shell on wayland. How do I tell it to stop drawing titlebars? I used to use pixel-saver extension but it no longer works. Even then I want all titlebars eliminated, not just maximized ones. – robru May 12 '17 at 17:47
  • There is no real way to disable the client-side decorations in Wayland without patching GTK+ itself. – ebassi May 13 '17 at 14:42