[GTK3] Completely remove top/right padding for window buttons

UNCONFIRMED
Unassigned

Status

()

defect
P3
normal
UNCONFIRMED
6 months ago
25 days ago

People

(Reporter: aros, Unassigned)

Tracking

(Blocks 1 bug)

Trunk
Desktop
Linux
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:64.0) Gecko/20100101 Firefox/64.0

Steps to reproduce:

Can we please discuss the top and right padding for [titlebar] window buttons?

  • All versions of Windows don't have it whatsoever.
  • A lot of popular XFCE/KDE windows manager themes also don't have it.

What's the reason Firefox has it?

Currently you cannot blindly move the mouse cursor to the top right corner and close Firefox which works for all other applications here in Windows/XFCE/KDE.

If Mozilla UX designers believe the padding is necessary, please give us an option to remove it completely.

Thank you.

Blocks: gtktitlebar
Component: Untriaged → Widget: Gtk
OS: Unspecified → Linux
Product: Firefox → Core
Hardware: Unspecified → Desktop

This has been happening on KDE Neon user edition since CSD in Firefox came available, I think.
Can be seen in this picture: https://i.imgur.com/v49T8t7.png (the window is maximized even though the max/unmax button isn't rectangular as usually in Breeze theme)
It's quite annoying as one can't just swipe the mouse to the up right corner to close, like in any other Windows or Linux desktop environments I have used.

Do other Gtk3 applications (gedit for instance) have the padding in maximized state? Thanks.

Flags: needinfo?(aros)
Priority: -- → P3

On my KDE Neon Plasma desktop:

I tried gedit and then Nautilus, and indeed the padding bug appears in them too: https://i.imgur.com/f7bZ7Z4.png

I have also used some apps that AFAIK use GTK3 but work as they should:
remmina (1.2.0-rcgit.29+dfsg-1ubuntu1)
thunderbird (60.7.0)
libreoffice (1:6.0.7-0ubuntu0.18.04.6)
synaptic (0.84.3ubuntu1)
All those non-affected apps seem to use the default KDE/kwin titlebar.
Both gedit and Nautilus seem to use some kind of CSD titlebars.

So for my system the bug seems to appear in (all?) GTK3 + CSD apps.

On my 1680x1050 pixels screen it looks like the padding is:
Firefox: 3 px from top and 6 from right
gedit: 9 px from top and 6 from right
Nautilus: 8 px from top and 6 from right

(P.S. In the image of my previous comment the "1 px border..." on left doesn't seem related to this, it is a KDE bug.)

(In reply to Martin Stránský [:stransky] from comment #2)

Do other Gtk3 applications (gedit for instance) have the padding in maximized state? Thanks.

GTK3 applications do not have their own window decorations, so your question doesn't make sense.

I'm now running XFCE4/XFWM and there's no padding at all - all maximized windows can be closed by moving the mouse to the top right corner.

Flags: needinfo?(aros)

(In reply to Martin Stránský [:stransky] from comment #2)

Do other Gtk3 applications (gedit for instance) have the padding in maximized state? Thanks.

No, gedit nor gtk3-demo don't have any. Meaning you can close them by clicking in the top right corner, but this doesn't work in Firefox.

(In reply to mthw0 from comment #5)

(In reply to Martin Stránský [:stransky] from comment #2)

Do other Gtk3 applications (gedit for instance) have the padding in maximized state? Thanks.

No, gedit nor gtk3-demo don't have any. Meaning you can close them by
clicking in the top right corner, but this doesn't work in Firefox.

Can you try to run browser toolbox and find where the padding comes from by inspector tool? (https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox)
Thanks.

Is this any help? I mean, I don't know what I am doing. https://imgur.com/a/yiHXQBK

(In reply to mthw0 from comment #7)

Is this any help? I mean, I don't know what I am doing.
https://imgur.com/a/yiHXQBK

Almost there. That tool allows you to inspect property of the elements and also source of the property, if that's computed or derived from toolkit. You need to find another inspector window with the actual button properties.

I have found something that might be related: https://imgur.com/a/ZHiRTUv

So, It is possilbe to fix this issue by setting margin-right and margin-top to -X px, But the problem is that the X value needs to be different for different themes. For example Breeze theme has quite small buttons that would need a lot of moving. See: https://imgur.com/a/lpRbd3c. Or in other words, the area that reacts to mouse clicks is button-image-size dependent and it shouldn't be.

Posted image top.png

(In reply to Martin Stránský [:stransky] from comment #6)

(In reply to mthw0 from comment #5)

(In reply to Martin Stránský [:stransky] from comment #2)

Do other Gtk3 applications (gedit for instance) have the padding in maximized state? Thanks.

No, gedit nor gtk3-demo don't have any. Meaning you can close them by
clicking in the top right corner, but this doesn't work in Firefox.

Can you try to run browser toolbox and find where the padding comes from by inspector tool? (https://developer.mozilla.org/en-US/docs/Tools/Browser_Toolbox)
Thanks.

I wasn't able to find any padding using the browser toolbox but I've discovered an interesting detail. My new tab button is at the left top corner and it has no padding at all, i.e. it behaves exactly how the minimize/maximize/close buttons should work in theory.

AFAICT there are two issues resulting in the current situation:

  1. When using a gtk theme that has window buttons big enough like Qohir-win, you can close maximized windows of apps like gtk3-demo, pamac, nautilus, ... But you cannot close firefox. This can be fixed by setting margin-top and margin-right to -X px.
  2. If you use a gtk theme with smaller window buttons like Adwaita (default for gnome), Breeze (default for KDE) or generally ~90% of other themes, you cannot close ANY window by clicking the top right corner, simply because the button is too small and thus too far from where you are clicking. This is a gtk bug or feature.

(In reply to mthw0 from comment #14)

AFAICT there are two issues resulting in the current situation:

  1. When using a gtk theme that has window buttons big enough like Qohir-win, you can close maximized windows of apps like gtk3-demo, pamac, nautilus, ... But you cannot close firefox. This can be fixed by setting margin-top and margin-right to -X px.
  2. If you use a gtk theme with smaller window buttons like Adwaita (default for gnome), Breeze (default for KDE) or generally ~90% of other themes, you cannot close ANY window by clicking the top right corner, simply because the button is too small and thus too far from where you are clicking. This is a gtk bug or feature.

I'm not sure what you're talking about. Firefox on Linux is rendering its own title bar. It does not depend on a window manager and/or your currently selected window decorations theme.

I'm not sure what you're talking about. Firefox on Linux is rendering its own title bar. It does not depend on a window manager and/or your currently selected window decorations theme.

Yes, it doesn't depend on window decoration themes when using CSDs, but it does depend on a GTK theme, that's where the button size comes from.

That's why I said that, the problem isn't caused by the button having a padding or a margin. I believe it's caused by you not being able to close the window by clicking in the area around it. In chromium this is possible, see the attachment. The solution would be to implement this also in Firefox.

(In reply to mthw0 from comment #5)

(In reply to Martin Stránský [:stransky] from comment #2)

Do other Gtk3 applications (gedit for instance) have the padding in maximized state? Thanks.

No, gedit nor gtk3-demo don't have any. Meaning you can close them by clicking in the top right corner, but this doesn't work in Firefox.

To be more exact, only if the GTK theme you use has window buttons big enough, like Qogir-win. Otherwise you cannot. Also this sounds more like a GTK bug.

You need to log in before you can comment on or make changes to this bug.