Skip to content

[Bug]: Application window does not have border shadow on KDE Plasma desktop environment (or not using mutter) #36768

Closed

Description

@easyteacher

Preflight Checklist

Electron Version

21.3.2

What operating system are you using?

Other Linux

Operating System Version

openSUSE Tumbleweed 20221228

What arch are you using?

x64

Last Known Working Electron version

No response

Expected Behavior

Application window has border shadow on KDE Plasma Desktop

Actual Behavior

No border shadow when using kwin. The border shadow is visible when using mutter on KDE Plasma Desktop.

Testcase Gist URL

No response

Additional Information

No response

Activity

  1. easyteacher commented on Jan 2, 2023

    @easyteacher
    Author

    I was told to report the bug here because window manager is not responsible for CSD shadow.

  2. wen-zheng commented on Jan 14, 2023

    @wen-zheng

    encountered the same issue

  3. github-actions commented on Jun 27, 2023

    @github-actions
    Contributor

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  4. wen-zheng commented on Jun 27, 2023

    @wen-zheng

    this issue still exists

  5. electron-issue-triage commented on Sep 27, 2023

    @electron-issue-triage

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. If you have any new additional information—in particular, if this is still reproducible in the latest version of Electron or in the beta—please include it with your comment!

  6. detiam commented on Sep 27, 2023

    @detiam

    bump

  7. wen-zheng commented on Oct 3, 2023

    @wen-zheng

    bump

  8. detiam commented on Oct 3, 2023

    @detiam

    @wen-zheng seems the only way is let the app developer draw something like box-shadow around main window? kwin can't only add shadow for window when server side decoration off.
    electron app that have shadow on kwin: https://github.com/lyswhut/lx-music-desktop

  9. 44 remaining items

  10. marbaa commented on Dec 10, 2025

    @marbaa

    I think it is not rocket science to find out who should fix the problem. If application uses own theme/decoration, then logically drawing all window decorations (including shadows) must be handled by application and not by DE. Otherwise developer of custom application might blame DE that it screw up design of application or whatever. Thing that shadows were working on Mutter (not anymore), doesn't means that problem is on KDE. They might made some workaround.

    I understand that KDE is not implementing any workaround fix. Stick to native theme which we provide or manage all decorations by youself.

  11. ivoanjo commented on Dec 10, 2025

    @ivoanjo

    @marbaa I realize this is an annoying bug but I'll gently point out to try to remember this project has a code of conduct https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md and that blaming people is probably not going to motivate a speedier fix.

  12. sedax90 commented on Dec 10, 2025

    @sedax90

    @marbaa I realize this is an annoying bug but I'll gently point out to try to remember this project has a code of conduct https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md and that blaming people is probably not going to motivate a speedier fix.

    I don't think we can talk about a "speedier fix" after 3 years...

  13. setzor commented on Dec 22, 2025

    @setzor

    bump

  14. ja11sop commented on Dec 23, 2025

    @ja11sop

    Noting that as I understand it Mattermost desktop suffers from this (no shadow or border) on Plasma. It used to be possible to add a window rule to force adding native titlebar and borders which then allow the shadow to be drawn but now that doesn't even work. This is definitely an electron issue which seems to be affected by defaults use in apps like Mattermost. I suspect "better behaved" apps do some extra work and so things appear ok, but for some, like Mattermost - it is just broken. No shadows, no workaround (KDE Plasma 6.5.4, mattermost-desktop 6.0.2)

  15. JerryI commented on Dec 24, 2025

    @JerryI

    Noting that as I understand it Mattermost desktop suffers from this (no shadow or border) on Plasma. It used to be possible to add a window rule to force adding native titlebar and borders which then allow the shadow to be drawn but now that doesn't even work. This is definitely an electron issue which seems to be affected by defaults use in apps like Mattermost. I suspect "better behaved" apps do some extra work and so things appear ok, but for some, like Mattermost - it is just broken. No shadows, no workaround (KDE Plasma 6.5.4, mattermost-desktop 6.0.2)

    You may still provide platform info to DOM root element and draw on body 1px border line. Some apps do that (including mine), it improvs readability a lot, but no shadows...

  16. heroin-moose commented on Dec 25, 2025

    @heroin-moose

    Okay, to give some technical details. There is a Wayland protocol called xdg-decoration-unstable-v1. It controls whether an application window should draw the title bar and shadows itself or not. There is also older KDE-specific protocol called kde-server-decoration.

    Now, what I'm seeing on Mattermost and Obsidian:

    Mattermost 5.8 (Electron 29.3.0)

    $ WAYLAND_DEBUG=1 ./mattermost-desktop-5.8.0-linux-x64/mattermost-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland 2>&1 | grep -E '(set_mode|default_mode)'
    [1277970.292] [email protected]_mode(2)
    [1432605.895]  -> [email protected]_mode(2)
    

    This means that the application requests server-side decorations.

    Mattermost 5.9 (Electron 31.2.1)

    $ WAYLAND_DEBUG=1 mattermost-desktop-5.9.0-linux-x64/mattermost-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland 2>&1 | grep -E '(set_mode|default_mode)'
    [1408129.110] [email protected]_mode(2)
    [1412319.337]  -> [email protected]_mode(1)
    

    This means that the application requests client-side decorations.

    Same with Obsidian. However, it provides a setting to request SSD. In this case, KDE draws the decorations.

    So, the application requests CSD, KDE provides CSD. The behavior probably changed between Electron 29 and Electron 31 (or between MM 5.8 and 5.9).

    P.S. This change probably comes from Chrome, not Electron itself.

  17. dominichayesferen commented on Dec 25, 2025

    @dominichayesferen

    Okay, to give some technical details. There is a Wayland protocol called xdg-decoration-unstable-v1. It controls whether an application window should draw the title bar and shadows itself or not. There is also older KDE-specific protocol called kde-server-decoration.

    Now, what I'm seeing on Mattermost and Obsidian:

    Mattermost 5.8 (Electron 29.3.0)

    $ WAYLAND_DEBUG=1 ./mattermost-desktop-5.8.0-linux-x64/mattermost-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland 2>&1 | grep -E '(set_mode|default_mode)'
    [1277970.292] [email protected]_mode(2)
    [1432605.895]  -> [email protected]_mode(2)
    

    This means that the application requests server-side decorations.

    Mattermost 5.9 (Electron 31.2.1)

    $ WAYLAND_DEBUG=1 mattermost-desktop-5.9.0-linux-x64/mattermost-desktop --enable-features=UseOzonePlatform --ozone-platform=wayland 2>&1 | grep -E '(set_mode|default_mode)'
    [1408129.110] [email protected]_mode(2)
    [1412319.337]  -> [email protected]_mode(1)
    

    This means that the application requests client-side decorations.

    Same with Obsidian. However, it provides a setting to request SSD. In this case, KDE draws the decorations.

    So, the application requests CSD, KDE provides CSD. The behavior probably changed between Electron 29 and Electron 31 (or between MM 5.8 and 5.9).

    P.S. This change probably comes from Chrome, not Electron itself.

    That's literally just "can I has native titlebars?" the pseudo-standard basically, and has no part in this bug report as SSD-using Electron obviously is out of this issue's scope.

    What needs to be done to fix this issue is to, like Chromium itself, simply render a shadow around the window then use set_window_geometry(?) to make the shadows out-of-bounds regarding actual window geometry. You'd also need to detect snapping and disable the shadow and change the window geometry, but that's part in parcel... that, or somehow just render the window the way Chromium renders PWA windows (which is what Electron seems to be trending towards anyways due to the Chromium titlebuttons usage).

  18. heroin-moose commented on Dec 25, 2025

    @heroin-moose

    It’s not obviously out of scope, that’s basically the reason why it worked before and does not work now. Where to go from here is obviously debatable.

  19. heroin-moose commented on Dec 26, 2025

    @heroin-moose
  20. dominichayesferen commented on Dec 26, 2025

    @dominichayesferen

    It’s not obviously out of scope, that’s basically the reason why it worked before and does not work now. Where to go from here is obviously debatable.

    Having server-side decorations (xdg-decorations protocol) means the compositor handles both the titlebar, and in the process the shadows, instead of the application, which is indeed out of scope for this bug as it is only about applications that don't opt into native titlebars but rather:

    • Have Chromium titlebar buttons embedded into the window body (CSD with Chromium titlebuttons, e.g.: Visual Studio Code when titlebar is disabled)
    • Use entirely custom titlebars (fullly custom CSD, e.g.: Cursor, iirc)

    In both those CSD cases, not cases where a native titlebar is used instead when xdg-decorations is available, it is the application's job to render shadows around itself, thus what this bug is about (the lack of those very shadows it should be rendering).

    Also documentation still mentions the old behavior as the default one: https://www.electronjs.org/docs/latest/tutorial/custom-title-bar

    I'd personally report a bug to the documentation regarding that information being outdated.

    This all being said, getting the client-side decoration Electron to render shadows and have appropriate 'window geometry' is the most likely missing thing here that is causing this issue in Wayland, I'd assume (the non-standard frame-extents that GNOME created in X11's case).

  21. heroin-moose commented on Dec 27, 2025

    @heroin-moose

    Ah… I see what you mean. Yeah, kinda hijacked I guess, but given that Electron switched from SSD to CSD by default, this bug probably will become the catch-all for all “where is my usual KDE titlebar” due to it’s name.

  22. detiam commented on Feb 20, 2026

    @detiam

    Edit: Confirm with Electron 43 that border shadow on KDE on x11 is working.


    @ckerr @mitchchn But how about x11? KDE(Kwin) under x11 don't have server-side shadow for election, same as wayland. though mutter(Gnome/Ubuntu) has.

    I was told to report the bug here because window manager is not responsible for CSD shadow.

    https://github.com/electron/electron/pull/49295/changes#diff-072c60761ff5134318cd284d5a04c6e72cf08166629adaab3e9034151b52439cR30-R34

    Maybe Kwin x11 uses LinuxCSDFrameLayout too?

  23. cquasar commented on May 1, 2026

    @cquasar

    A workaround I've been using:

    Alt + f3 » More Actions » Configure Special Application Settings » Add Property » No titlebar and frame: Foce = No
    Before closing the popup copy the Window class (application) string

    Then on System Settings » Window Decorations » Edit icon on selected decoration » Add Window specific overwrite » Matching window property: Window Class Name » Paste Window class into "Regular expression to match" (you can also use the button Detect Window Properties) » Hide window title bar: Always

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions