elementary / stylesheet

The GTK Stylesheet for elementary OS
https://elementary.io
GNU General Public License v3.0
321 stars 74 forks source link

Window shadows are broken for QT apps, Mutter 44.1 #1260

Closed ludmiloff closed 1 year ago

ludmiloff commented 1 year ago

What Happened?

Screenshot from 2023-05-21 15 47 04@2x

Screenshot from 2023-05-21 15 48 55@2x

I'm using this elementary theme on Fedora 38, Mutter 44.1, GTK 4.10.3, GTK 3.24.37 and custom build of Elementary apps and shell. While most to things works as expected, I noticed a strange corruption of window shadows of certain apps, especially QT apps (vlc currently I have) and some non QT apps like dnfdragora or gparted - see the screenshots above.

Both Gnome shell (X11) and Pantheon shell are affected.

Tweaking the shadow parameters a bit seems to solve the problem:

https://github.com/elementary/stylesheet/blob/a845ccb1105f0ceaec10a5e5cb09e6accf36ab2f/src/gtk-4.0/widgets/_windows.scss#L10

my change in the file above, which is minimal enough and restores the shadows again:

window {
    &.csd {
        border-radius: rem(6px);
        box-shadow:
            // Intentionally not in ems since it's used as a stroke
            0 0 0 1px $toplevel-border-color,
            // Force shadows to be the same size to prevent jumpy resize transition
            0 10px 12px 4px transparent,
            shadow(4);

        &:backdrop {
            box-shadow:
                0 0 0 1px $toplevel-border-color,
                // Force shadows to be the same size to prevent jumpy resize transition
                0 10px 12px 4px transparent,
                shadow(2);
        }

Would be glad to see this fixed.

Steps to Reproduce

  1. Open a Qt application
  2. Move the window around
  3. A corruption or something appears around the window where the shadow should be.

Expected Behavior

Expected clean looking window shadow for every window regardless underlying toolkit.

OS Version

Other Linux

Software Version

Compiled from git

Log Output

No response

Hardware Info

My graphics card: AMD RX560, amdgpu driver, X11, 4k monitor, scaling factor: HiDPI (2x)

bobby285271 commented 1 year ago

Is this still an issue? I expect https://src.fedoraproject.org/rpms/gtk4/c/9e052585ca0834c1a34f4ba7ef4ab5c93d1c459b to fix this (for Fedora 38, you can check if your gtk4 is newer than gtk4-4.10.3-3.fc38, which has that as distro patch) :thinking:

ludmiloff commented 1 year ago

Yes, my system is already on gtk4-4.10.4. I reverted my changes and now everything is ok, thanks. With above mentioned gtk patch, I think this issue is irrelevant now and I'm closing this.