For now, any maximized Qt and GTK3 (no CSD) app can be fast closed by moving the mouse pointer to the right top corner then left click, without searching and precisely positioning the mouse pointer on that small close button, this makes closing any maximized window super easy.
But GTK4 and GTK3 with CSD apps don’t follow this rule, which forces the user to precisely click on the close icon.
Is there any effect/hack that can add an action to the top right corner and makes it easy to close the current maximized window ?
Windows close on alt+F4 I guess. If you emulate that with xdotool, it doesn’t matter if it’s csd or not. I use a top panel to which I added a widget called Spacer As Pager which allows me to do just that, top right corner and left click.
There’s also a custom screen edge script called KwinEdgeCommands but I didn’t take the time yet to look at the little error in it.
And believe it or not, the Napoleonistic app hotcorners-xd even works on current kde. Even comes with a working Skippy-xd ! Go figure. Wouldn’t really recommend that though.
In either case, emulating the key shortcut with xdotool does csd windows as well.
On my openbox rigs I use an autostart xdotool command like: sleep3 && xdotool behave_screen_edge top-right exec xdotool key alt+F4
That doesn’t work on kde unless you set a screen margin.
Ok, here’s a not great solution - use the “screen edges” configuration to set a top right corner action of “Present Windows - current application”. When you stick the mouse in the corner, you get an overview with (hopefully just) the offending window and then a middle click anywhere on that large target will close it.
I took another look at the custom screen edge script and I didn’t manage to get it to work. Maybe I might, but I had to install a bunch of dependencies I’m not eager to. But as far as a lazy close, kde “specific” option, that spacer widget works just fine. It can be set to a very small px size, enables overview on middle or right click and mouse scroll. In my case I don’t need top right screen edge to overview anymore which leaves me kind of a “nonchalant” corner for the mouse move. Moreover, it does the job when you don’t use titlebars as well. That being said, a custom screen edge command option would be nice to have. How hard can it be.
This thing’s been around for ages, WITH custom actions:
As a sidenote, for the…“youngsters” who don’t know what skippy-xd is. It’s an exposé/overview type kinda thing that was made twenty years ago. Still works on pretty much any desktop ( or non) environment. I’m just sayin’.
They banned me a long time from their gitlab because I simply criticized their desktop slowness in a ticket.
KDE devs are way more open and really kind, I reported many bugs with many critics and the devs were totally lovely.
Hooking into this, this not only effects the close button, but in your mentioned example of Firefoxt this leads to tabs not being selectable from the top edge of the screen, insteasd, the window will de-maximize on click on the top edge of the screen.
This was not always the case however. I remember not needing to precisely hit a tab in the bar before.
A, ok. Didn’t know that. I’m afraid you don’t many options then. Not unless kde implements a custom screen edge or someone comes up with a working script.
Maybe some css of the padding of the close buttons on gtk csd could work.
I’m sure I came across a custom script once, but for the love of…I can’t find that anymore. In either case, as I mentioned before, I’m afraid your only option is css in the gtk config file. Something like 0 margin and padding for the close button.