Maximal: a clean solution to hide the titlebar of maximized windows (Gnome, Cinnamon)

EDIT: I’ve added a package to the AUR, simply run yaourt -S maximal.

maximal is my take on a pretty much demanded feature. I want to share it here since there are many Gnome (and Cinnamon, although it won’t work for Cinnamon until its next release) users around this forum. Maximal was born out of disconformity with the current state of affairs:

  1. The “maximus like” extensions are very clever but dirty, dirty hacks that try to infer the client id in non standard ways, call external tools, hook from many events… don’t get me wrong, it’s impressive that the extension developers somehow managed to get around the limitations imposed by the “everything CSD” adamant stand of Gnome. But anyway the extensions make the programmer in me cry in despair. Moreover, they all show some rough edges.

  2. Another option is to tweak the metacity theme to make the titlebar almost invisible, setting a 0 size font… I’m going to stop here.

  3. Finally there is a script around there that is always pulling information from the X system and setting _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED for every client. But it should be the other way around, the script should react to window creation events.

OTOH maximal, a quite minimal script indeed, simply listens to normal window creation events and sets the _GTK_HIDE_TITLEBAR_WHEN_MAXIMIZED property. For more information check the README file for the project, but here are some highlights:

  1. You can set a whitelist and/or a blacklist of patterns to match the wm class, instance and name of the client.
  2. You can disable/resume the service. After disabling it everything is left as it was before.
  3. Only requires standard tools, probably already available in your system.
  4. It’s simple and does the right thing, it’s not a hack nor a workaround. This doesn’t mean that it’s free of bugs, of course, just that the approach is straightforward.
7 Likes

I’m not using gnome or cinnamon myself but I’m a big fan of global menus so hiding titlebar in maximized state goes with it.

I found it very lacking experience on gtk based DEs because of window buttons don’t follow gtk themes automatically. Some can be manually tweaked to use proper graphics but it’s not always possible or easy. For example, Mate has awesome global menus and hiding titlebar but switching to any non default gtk theme is just breaking visual experience.

Another part of it is the side where window buttons show up. Some prefer right, some left. Current CSD’s break cutomizability because there is no way to force buttons on the same side by system setting - firefox or chrome are examples of that. That is why I prefer SSD like on Plasma which I can set as I want and make coherent with various themes and effects.

So my question is, is your extension dealing with window buttons style and the side they appear on or not yet?

Maximized windows have no decorations at all, which means no buttons, you will have to use super-down to unmaximize and get the decorations again. If you want buttons integrated in the top bar use the pixel saver extension. It works quite well, although it shows some weird visual artifacts when returning back from the lock screen and its code is a bit of a mess because mutter api is crippled (you might want to vote for https://gitlab.gnome.org/GNOME/mutter/issues/211 and https://gitlab.gnome.org/GNOME/mutter/issues/212).

Rant: I’m not a big fan of csd myself. It has its pros and its cons, of course, but imo some kind of hideable menu bars (maybe coupled with a ctrl+p style toolkit provided feature) would conveniently have saved vertical space without starting a desktop revolution that nobody is sure where is leading to, but that surely is once and again pushing against both end users and downstream developers expectations. Maybe it will rollback in the end, maybe gnome obstination will eventually render fruit, who knows. But at this point you have to accept it or fork the way cinnamon did with its xapps, which is a sad state of affairs (I’m not against creative destruction, but this seems to have gone too far for too little).

Regarding decorations: conceptually they’re part of the wm, once you integrated them into the client, and specially in such a fragmented ecosystem as the linux desktop/toolkit is, expect inconsistency. It has been difficult to get a consistent systray after so many years, it will be next to impossible having apps installed from snaps, flatpaks, some qt, some gtk 3, some gtk 4, some electron, etc. showing basic window management buttons, focus state, etc. in a consistent way. If you want consistency probably you will have to lock yourself in to some particular desktop environment and toolkit and even so many important tools will be out of the scope of that desktop and ymmv then (the browser, for instance, take a look at the new firefox csd, looks great at first glance until you realize its maximize button doesn’t behave the same the ones in the gnome suite and that the bar doesn’t signal focus state at all).

“The year of the linux desktop”, that joke isn’t funny anymore.

True but this can be tamed to some extend and to my experience only on Plasma I can do that: both Qt and Gtk programs look similar, global menus work in most programs (Qt, Gtk, electron, Libre Office), there is no problem with styling window buttons on panel, because of SSD on kwin all programs have it and it looks and behaves consistently. Sure, there are some exceptions (Spotify looks always the same) and I can choose not to use flatpacks (there is no big need on Arch based system as we have easy access to programs) so my Plasma theming is not broken.

Here are the examples:

1 Like

For me hiding titlebar of maximized windows is strictly tied with global menus and window buttons on panel (in maximized state). If those are considered separately we get such nightmares as on Gtk DEs. Only on Gnome you can manually edit paths in pixel saver to have correct buttons from chosen gtk theme but you still don’t have well working global menus. In Mate you have great global menus but modifying of panel buttons seems to be impossible or at least I never found a way (changing anything breaks the default setting and ugly fallback icons take place).

I never tried global menus and such things on cinnamon thou. When I used cinnamon, I was new to Linux so I wasn’t experimenting this much with themes and settings.

I’m always amazed (negatively) that most solutions on Gtk systems are… fragmented and they never approach it as a whole. Maybe it’s just too complicated given the nature of Gtk and how easily it brakes UI between each versions. This is not a good base to work on - you can add some cool stuff and in next release it won’t be even possible because API won’t exist anymore.

On Plasma solutions are also fragmented but because each modules are extremely customizable and reliable, it’s possible to find a common denominator. In fact, I can find many of them so I’m not limited to few “true” choices, but of course it requires some work to get it all aligned on Plasma and you can’t be sure that all will work well across all interfaces. For example, my current setting is about 90% or even more ok but there are few places where fonts become white on white background. I believe it’s because my color palette (breeze) is not matching completely chosen Kvantum theme and I would have to modify colors to make it perfect but since in most places it’s ok, I just leave it as it is.

But I constantly go into theming topic and comparison of DEs and that’s not the discussion here, so sorry to go off topic.

My point is: hiding titlebar is tied strictly to global menus and panel buttons and I would love to see viable and well executed solutions on Gtk DEs, just for the sake of diversity. Also, Cinnamon or Gnome can be very well looking if properly tweaked. So anyway, do you think you could extend Maximal to add also buttons that follow Gtk theme?
Basically I’m asking for a better version of pixel saver. If we cannot count for well executed global menus on Gnome let’s have one thing right. It saves space and looks good on SSD applications. Gnome devs seem to want all CSDs but they never get it across all possible programs, they are crazy and delusional if they think they can.

So anyway, do you think you could extend Maximal to add also buttons that follow Gtk theme?

No, it works at a completely different level, it’s all xlib, not a shell extension.

You can try luck with https://extensions.gnome.org/extension/1267/no-title-bar/ also.

Extensions use mutter api to hook from workspace/window creation events, I’m using the xlib api to listen to creation and map x11 events instead. It’s funny that the code to get the current client id in those extensions is longer and more convoluted than the entire maximal script.

At the code level the best way forward is to make those extensions saner, and you can help voting up the issues I opened in mutter tracker for inclusion of an api to get the client id. Maybe the developers are reluctant to do so because they only care about wayland and csd, who knows, they’re not very communicative to say the least. Gnome is the desktop of the uncertain future, for people living in the present there are better options.

1 Like

The complexity of those extensions is also a concern for the user, of course, because they’re not very actively maintained, some of them are abandoned, all have some problems with corner cases, etc. It’s not just the coder in me feeling dismayed but the user being concerned too.

It can be done, restricted to some themes, up to some extent and with a disproportionate amount of effort, I won’t deny that.

Btw, nice desktop you have there!

Thanks. I’m a theming freak :wink: and my requirements are very high.

I started with Mint Cinnamon, then I moved to Plasma and Gnome which were installed together and I was switching from one to another, just for sake of diversity. Then Plasma added global menus, AWC extended possibilities, latte was developed, Plasma added more and more cool features with each version and Gnome was losing important to me options and offered nothing of use. The gap widened so I decided to get rid of gnome completely. I sometimes check it in vbox but it’s not enough. I’m glad that new extensions are showing up that work also on wayland but gnome feels like a child toy in comparison. I still hope that some day gnome devs come to their senses or with new development platform they get things in grip. Probably pipe dreams…
Gtk/Gnome had to be community driven to get normal, alas it’s not, at least not in the core and that’s probably why such difference. That’s my theory at least. The same problems were visible on Unity side (so also with corporate backing): lack of good communication, people want something, it’s ignored and some things are added but not what people asked about and frankly, pace was horribly slow, at least from user perspective. The same is with gnome despite all its backup. I suspect that lot is happening on code level, breakages won’t do themselves… but visible things are small or rather absent because we are blessed with vanishing option. I cared about those options… It’s sad because gnome did many things well and potential is there so I’m watching, maybe things turn around finally.
Uh… again went ranting off topic :frowning: Sorry.

Here is how my desktop works (recorded still on Plasma 5.12 so without that awesome blur and gimp theming was not yet adjusted):

Really weird, it looks almost like my desktop :exploding_head:. In the functional way obviously, with all of the global menus and window buttons in xfce im having a great experience, just install packages and change the theme for the buttons(or let it get in sync with xfwm4) and done.

Just out of curiosity, what was your set-up in Cinnamon?

This was 3 years ago so I don’t remember details. I had some fully transparent upper panel and probably docky. I didn’t know that such thing as global menus exist back then. I mean I saw them on unity but I didn’t know how are they named or if they are possible elsewhere.

I don’t know xfce that much beside that I dislike whisker menu and that hideous calendar so I never tried any global menu setup on it. Still, it’s good to hear that xfce is that flexible. Probably xfce is the most flexible of Gtk DEs (high modularity) so I do believe one can achieve a lot with it.

@Potato, can you post some screenshots showing how it looks and works? Or better yet, do a vid ;D.

1 Like

Can’t make a video, using a netbook. Left side global menu, Right side window buttons. Now i just need blur, compiz has it, but netbook says hell no boi.

Nice. Can you move buttons to the left? Also, dynamic panel would be nice since it gives better readability. I know I probably shouldn’t expect all of Plasma features in that setup but I’m just curious of how far it can be tweaked.

In Xfce we don’t have dynamic panel sadly, and yes you can move the buttons anywhere you want.

The code looks pretty clean, nice general solution!

I tried maximal on current version of gnome, which is 3.32.2 right now, and it didn't work for me.

Any ideas to hide titlebar of maximized windows?
Specifically, I want to hide titlebar of VirtualBox.

I'm the original author, not the current maintainer, I reported this a few months ago in the current fork tracker: https://github.com/crazygolem/maximal/issues/2. Maximal used a gtk specific property that sooner or later was going to be removed. I would advice that you accept that some apps still have a legacy title bar. Hopefully they will make clever use of a modern header bar in the not so distant future. All remove-titlebar extensions are awful hacks because of the lack of support for that almost obsolete feature. Maximal was a shortlived exception.