Bug 414777 - Top-right-most pixel does not trigger right-most button in a GTK3 CSD headerbar app
Summary: Top-right-most pixel does not trigger right-most button in a GTK3 CSD headerb...
Status: RESOLVED FIXED
Alias: None
Product: Breeze
Classification: Plasma
Component: gtk theme (show other bugs)
Version: 5.21.4
Platform: Other Linux
: HI normal
Target Milestone: ---
Assignee: Janet Blackquill
URL: https://gitlab.gnome.org/GNOME/gtk/-/...
Keywords:
: 421937 430632 434734 434897 450946 467021 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-12-02 23:32 UTC by Nate Graham
Modified: 2023-05-29 18:53 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.27.4


Attachments
bug (19.22 KB, image/jpeg)
2021-04-19 01:26 UTC, Lua
Details
margin (44.54 KB, image/png)
2021-04-29 20:09 UTC, Lua
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nate Graham 2019-12-02 23:32:07 UTC
When you maximize or right-tile a GTK3 CSD headerbar app, the top-right-most pixel in the screen doesn'r trigger the button on the far right position on the headerbar--usually the close button. It does do this for apps using the Breeze QWidgets theme, but this does not work for CSD-using GTK3 apps using the Breeze-GTK theme
Comment 1 Nate Graham 2020-08-09 13:33:39 UTC
*** Bug 421937 has been marked as a duplicate of this bug. ***
Comment 2 Nate Graham 2021-01-05 16:57:44 UTC
*** Bug 430632 has been marked as a duplicate of this bug. ***
Comment 3 Nate Graham 2021-03-22 01:50:04 UTC
*** Bug 434734 has been marked as a duplicate of this bug. ***
Comment 4 Nate Graham 2021-03-24 19:20:10 UTC
*** Bug 434897 has been marked as a duplicate of this bug. ***
Comment 5 Lua 2021-04-19 01:26:04 UTC
Created attachment 137696 [details]
bug

It seems that there are some margins preventing the buttons to fully expand.
Comment 6 Lua 2021-04-19 01:26:52 UTC
I forgot to mention: I opened Spectacle and Firefox to show this bug while I'm using Qogir window decoration theme.
Comment 7 Lua 2021-04-19 17:39:29 UTC
Also, this still happens in KDE 5.21.4
Comment 8 Lua 2021-04-29 20:09:24 UTC
Created attachment 138012 [details]
margin

This still happens in KDE 5.21.4. It seems that there's a margin in the window buttons panel. If Qogir theme (square version) is applied, this problem gets more noticeable.
Comment 9 guimarcalsilva 2022-01-19 17:39:51 UTC
After reading Nate's blog post about the 15-Minute Bug Initiative (https://pointieststick.com/2022/01/18/the-15-minute-bug-initiative/), I believe this bug is a nice candidate for the list. GTK apps are a big part of the Linux desktop and this issue can be seen pretty quickly by any user who switches to using Plasma from other GTK DEs and want to keep using the programs they were used to. This also has 4 duplicates, so it's something that has been affecting a considerable amount of people.
Comment 10 Nate Graham 2022-01-19 17:41:05 UTC
Fair enough!
Comment 11 Nate Graham 2022-03-21 04:28:37 UTC
*** Bug 450946 has been marked as a duplicate of this bug. ***
Comment 12 Nate Graham 2022-05-17 19:04:34 UTC
Unfortunately this is an upstream bug in GTK itself that we can't work around in the Breeze GTK theme. See https://gitlab.gnome.org/GNOME/gtk/-/issues/583
Comment 13 Nate Graham 2023-03-13 15:28:29 UTC
*** Bug 467021 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2023-03-13 15:35:05 UTC
In progress with https://invent.kde.org/plasma/breeze-gtk/-/merge_requests/71 since it turns out we *can* work around it in breeze-gtk and the GTK folks don't seem interested in fixing it generically.
Comment 15 Fushan Wen 2023-03-29 16:53:23 UTC
Git commit 0f887127b929ac2d50b22af1bb97fc25411b40aa by Fushan Wen.
Committed on 29/03/2023 at 16:52.
Pushed by fusionfuture into branch 'master'.

gtk4/windowcontrols: extend control area to window borders

This makes GTK4 window control buttons follow Fitts' law.

M  +42   -152  src/gtk4/widgets/_window_decorations.scss

https://invent.kde.org/plasma/breeze-gtk/commit/0f887127b929ac2d50b22af1bb97fc25411b40aa
Comment 16 Fushan Wen 2023-03-29 16:53:31 UTC
Git commit d11333a830a4fdf6482c176e9a036e236bc80134 by Fushan Wen.
Committed on 29/03/2023 at 16:52.
Pushed by fusionfuture into branch 'master'.

gtk3/titlebutton: extend control area to window borders

M  +21   -9    src/gtk3/widgets/_window_decorations.scss
M  +7    -3    src/gtk4/widgets/_window_decorations.scss

https://invent.kde.org/plasma/breeze-gtk/commit/d11333a830a4fdf6482c176e9a036e236bc80134
Comment 17 Fushan Wen 2023-03-30 00:21:56 UTC
Git commit 59448164f7df462ae4a2c1119f6be59146d60399 by Fushan Wen.
Committed on 29/03/2023 at 16:56.
Pushed by fusionfuture into branch 'Plasma/5.27'.

gtk3/titlebutton: extend control area to window borders
(cherry picked from commit d11333a830a4fdf6482c176e9a036e236bc80134)

M  +21   -9    src/gtk3/widgets/_window_decorations.scss
M  +7    -3    src/gtk4/widgets/_window_decorations.scss

https://invent.kde.org/plasma/breeze-gtk/commit/59448164f7df462ae4a2c1119f6be59146d60399
Comment 18 Fushan Wen 2023-03-30 00:22:05 UTC
Git commit 83f4f7c184954eb89aaea52684f1ce076873e8c3 by Fushan Wen.
Committed on 29/03/2023 at 16:56.
Pushed by fusionfuture into branch 'Plasma/5.27'.

gtk4/windowcontrols: extend control area to window borders

This makes GTK4 window control buttons follow Fitts' law.
(cherry picked from commit 0f887127b929ac2d50b22af1bb97fc25411b40aa)

M  +42   -152  src/gtk4/widgets/_window_decorations.scss

https://invent.kde.org/plasma/breeze-gtk/commit/83f4f7c184954eb89aaea52684f1ce076873e8c3
Comment 19 Bug Janitor Service 2023-05-10 04:31:35 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/breeze-gtk/-/merge_requests/83
Comment 20 Fushan Wen 2023-05-22 14:37:21 UTC
Git commit cbab51eebfe21827830ada2ee4b339c43371ca86 by Fushan Wen.
Committed on 10/05/2023 at 04:28.
Pushed by fusionfuture into branch 'master'.

gtk3: revert button padding hack

When Firefox draws its window controls, margins and paddings are
also considered, so we can't use button padding hack to expand the
control areas of window controls.

M  +0    -35   src/gtk3/widgets/_window_decorations.scss

https://invent.kde.org/plasma/breeze-gtk/commit/cbab51eebfe21827830ada2ee4b339c43371ca86
Comment 21 Fushan Wen 2023-05-22 14:39:23 UTC
Git commit 2f2923c2a5ce8b656e2f531bb0791c1ec105873a by Fushan Wen.
Committed on 22/05/2023 at 14:39.
Pushed by fusionfuture into branch 'Plasma/5.27'.

gtk3: revert button padding hack

When Firefox draws its window controls, margins and paddings are
also considered, so we can't use button padding hack to expand the
control areas of window controls.


(cherry picked from commit cbab51eebfe21827830ada2ee4b339c43371ca86)

M  +0    -35   src/gtk3/widgets/_window_decorations.scss

https://invent.kde.org/plasma/breeze-gtk/commit/2f2923c2a5ce8b656e2f531bb0791c1ec105873a
Comment 22 Emilio Cobos Álvarez (:emilio) 2023-05-29 18:19:05 UTC
(In reply to Fushan Wen from comment #21)
> When Firefox draws its window controls, margins and paddings are
> also considered, so we can't use button padding hack to expand the
> control areas of window controls.

FWIW if Firefox was the only app affected I'd be happy to help making it work.

Negative margins aren't considered [here](https://searchfox.org/mozilla-central/rev/f4d3fe187cf7dffa4c13b354bbde9bc47b5ccd3f/widget/gtk/gtk3drawing.cpp#285-297), so probably it's a matter of tweaking that code appropriately.
Comment 23 Emilio Cobos Álvarez (:emilio) 2023-05-29 18:53:07 UTC
(In reply to Emilio Cobos Álvarez (:emilio) from comment #22)
> (In reply to Fushan Wen from comment #21)
> Negative margins aren't considered
> [here](https://searchfox.org/mozilla-central/rev/
> f4d3fe187cf7dffa4c13b354bbde9bc47b5ccd3f/widget/gtk/gtk3drawing.cpp#285-297),
> so probably it's a matter of tweaking that code appropriately.

I was wrong and margins are accounted for elsewhere (see `buttonMargin` in that file), so it needs some more debugging, but I'd be happy to help either way.