Hide Title Bar When Maximized in GNOME 3.16

6,589

To get to the core of why the metacity theme tweak no longer works we have to look at the gnome blog itself where gnome developer where Florian Müllner explains that when drawing the title bars gnome no longer uses metacity at all and they are always drawn by Gtk+

This means that a css answer is the only one that will work and I believe you are most of the way there. I read on this commit page that the css you want is somewhat like this:

.maximized .header-bar.default-decoration {
  padding: 0;
  font-size: 0.7em;
}

.maximized .header-bar.default-decoration .button.titlebutton {
  padding: 0;
  border-width: 0;
}

The reason the css can't hide or remove the element like it can with html (or svg) is that the css applies to gtk properties and the visibility of an object isn't a property in the typical Gtk way. You actually have to call widget.hide() from code. Similar to how Gimp themes have to hide widgets by making them the same colour as the background as a hack.

Share:
6,589

Related videos on Youtube

Sir_FZ
Author by

Sir_FZ

Updated on September 18, 2022

Comments

  • Sir_FZ
    Sir_FZ almost 2 years

    In GNOME 3.14 and 3.12, I had a modification in metacity-theme-3.xml which basically hides the title bar from any window when it's maximized. I preferred this method to the Maximus Two extension because the extension's behavior is inconsistent where sometimes I would see a transparent bar in place of the title bar on maximized windows (usually after resuming from a suspend).

    Now, in GNOME 3.16, the metacity tweak doesn't work anymore because GNOME no longer uses it. I've tried custom gtk3 css such as:

    .maximized .titlebar {
        display: none;
    }
    

    and variations of that, to no avail. Is this possible to achieve through gtk-3 custom css?

    Update: Pixel Saver is a good extension for doing just this without any bugs but I would still like to know if there's a way to do it manually.

    • Admin
      Admin about 9 years
      Where is your custom css?
    • Admin
      Admin about 9 years
      I placed it in ~/.config/gtk-3.0/gtk.css. I know it works because changing the text color for example works, but hiding the title bar (as I tried in my question) doesn't.
  • Sir_FZ
    Sir_FZ almost 9 years
    So the answer is that it's not possible to hide with pure CSS?
  • Martin Owens -doctormo-
    Martin Owens -doctormo- almost 9 years
    that's right, the css of gtk is quite poor.
  • Peter Weber
    Peter Weber over 6 years
    You seem to be right, visible and hide are not available. My temporary workaround is, using always GtkParasite (aka GtkInspector) to hide the header bar.