lah7 / gtk3-classic

Patches to bring back a traditional experience for GTK+3
Other
323 stars 25 forks source link

Double window controls in some CSD applications #32

Open lah7 opened 3 years ago

lah7 commented 3 years ago

Bug Description

gnome-disk-utility 40.0 shows double window controls: the actual window controls and a duplicate within the application. There is also a black border on the right/bottom.

The latest gtk3-classic against the older 3.38.2 does not inhibit the problem, so the GNOME developers made a change in their code.

Thankfully, it is still a GTK3 application and not GTK4, despite the versioning.

Expected Behaviour

The window controls inside the application should be hidden.

Workaround

Downgrade and pin the older version.

Screenshots

40.0 gnome-disks-40

3.38.2 gnome-disks-3 38 2

Environment

lah7 commented 3 years ago

Likewise, simple-scan 40.0 inhibits the same problem: double controls, and black border.

40.0

Screenshot_20210326_114039 Screenshot_20210326_114150

3.38.5

Screenshot_20210326_114407 Screenshot_20210326_114413

MR-Diamond commented 3 years ago

Also gnome-calculator 40.0

wb9688 commented 3 years ago

My guess would be that those are the apps using libhandy's HdyWindow and HdyHeaderBar and that that causes this behavior.

ZaWertun commented 3 years ago

Just fixed similar bug in my fork of gtk3-nocsd: https://github.com/ZaWertun/gtk3-nocsd/tree/test/libhandy. Some screenshots: изображение изображение

simifor commented 2 years ago

I looked at @ZaWertun's last commit, then browsed a bit gtk's tree to see where it'd and made a patch patch.txt full credits to zawertun really. This only fixes the black outlines seen in some places, as I didn't even touch the CSD related commits.

lah7 commented 2 years ago

Thank you @simifor, your patch.txt made it very easy to incorporate into the quilt patch system. Committed as 12f90e216bd894b27cfedc5b1eb918fd7cae4811

Thank you to @ZaWertun as well. I'm a bit lost on which commits to incorporate by looking at gtk3-nocsd's repository. Any help is much appreciated if anyone wishes to create a patch for this repository to fix this regression. I get confused with quilt too. 😅

N0rbert commented 2 years ago

Great! Thanks for merging. I think, we need to skip/disable both csd__clean-headerbar.patch and csd__disabled-by-default.patch temporarily for Ubuntu MATE 21.10 impish deb-packages to get GNOME native apps look better here, so without double borders.

lah7 commented 2 years ago

I noticed CSD applications under patched Ubuntu 21.10 doesn't look great, depending on the theme:

Screenshot_20220103_183047 Screenshot_20220103_183118 Screenshot_20220103_183138

For Ubuntu 21.10 users, I will revert those patches in the packaging since they ship newer (40.x) GNOME apps. Just until the "new" CSD is fixed, pull requests much appreciated!

Edit: In 22.04, this returns to using the default patchset, so double controls are expected.

daemonspudguy commented 2 years ago

I also noticed this with the program Pamac on Arch Linux.

servimo commented 2 years ago

I have this with EasyEffects on Manjaro too.

steven2024 commented 2 years ago

The same bug happens on gedit. image

bayazidbh commented 1 year ago

It seems to not be all, as I noticed that Lutris and FSearch (when CSD is enabled) doesn't have that issue while Komikku and Pamac has them. Potentially because of some hardcoded settings in their CSD setup?

Screenshots ![image](https://user-images.githubusercontent.com/26621899/183274026-b1e08276-b279-45de-8722-c924365f33af.png) ![image](https://user-images.githubusercontent.com/26621899/183274035-bad2760f-bcad-41a1-b18f-8b73124bfe2b.png) ![image](https://user-images.githubusercontent.com/26621899/183274007-fc09748c-b35f-4385-b45b-24022285ac21.png) ![image](https://user-images.githubusercontent.com/26621899/183274014-43bcfa8f-b78d-492d-b1f2-0bcedcf5b328.png)

For now the only thing that can be done is to just use GTK_CSD= set to 0 or 1. Which isn't an issue with those two apps I use, as I don't need the KDE window decoration features often with them and it's just an eyesore when not maximized.

Edit: For now the other thing that can be done is by manually changing gtk-decoration-layout= to :menu,appmenu in ~/.config/gtk-3.0/settings.ini though I don't know if this would be fine outside of KDE or not.

ghost commented 1 year ago

TL;DR: Application upstream design issue (not GTK)

I can't speak to all the examples given, but just analyzing the OP application (gnome-disk-utility):

I imagine (as most of the other examples are GNOME apps) that they did a similar switch to libhandy. In this case there's little we can do with a patched GTK to solve this issue (as libhandy is building the title bar and has no such checks to skip doing so on SSD or classic-style distributions).

probonopd commented 11 months ago

Opened an upstream issue: https://gitlab.gnome.org/GNOME/libhandy/-/issues/470

Please consider upvoting that upstream issue if you agree that this should be fixed in libhandy.

lah7 commented 11 months ago

I think the next course of action is to have a separately patched libhandy package that removes the CSD window buttons.

Personally I'm not up for maintaining that, but I'll happily link if anyone comes up with an AUR package for the offending library.

probonopd commented 11 months ago

Upstream says:

Even if I was interested in supporting that thing (I'm not), there's no way to do it from libhandy in the first place as it has no idea about any patches your GTK may or may not have. This isn't something that's possible to "support". It's like asking a website to support a user style better.

At least we have asked.