Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
3 tasks done
easyteacher opened this issue Jan 2, 2023 · 21 comments

Comments

@easyteacher
Copy link

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

@easyteacher
Copy link
Author

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

@wen-zheng
Copy link

encountered the same issue

@github-actions
Copy link
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!

@github-actions github-actions bot added the stale label Jun 27, 2023
@wen-zheng
Copy link

this issue still exists

@github-actions github-actions bot removed the stale label Jun 28, 2023
@electron-issue-triage
Copy link

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!

@detiam
Copy link

detiam commented Sep 27, 2023

bump

@wen-zheng
Copy link

bump

@detiam
Copy link

detiam commented Oct 3, 2023

@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

@wen-zheng
Copy link

wen-zheng commented Oct 3, 2023

@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

electron apps work fine on mutter, so it seems that it's not electron issue but kwin's issue, right?

@easyteacher
Copy link
Author

easyteacher commented Oct 3, 2023

If the shadow is drawn by electron itself, it probably means electron tries to detect the current platform, and only shows the shadow on GNOME.

See https://blog.vladzahorodnii.com/2020/07/23/csd-support-in-kwin/

@wen-zheng
Copy link

If the shadow is drawn by electron itself, it probably means electron tries to detect the current platform, and only shows the shadow on GNOME.

so modifying the detection logic is enough? can kwin draw the shadow normally after that? if not, kwin or electron which one we need to modify?

@easyteacher
Copy link
Author

See my previous reply

@RobotoSkunk
Copy link

bump

@Yasand123
Copy link

Has to be a KDE issue. When I used GNOME in the past Electron apps had borders and window shadows like other GNOME apps. You can even control the border radius via plugins. So it's a KDE limitation. It's really annoying, I agree.

@wen-zheng
Copy link

Has to be a KDE issue. When I used GNOME in the past Electron apps had borders and window shadows like other GNOME apps. You can even control the border radius via plugins. So it's a KDE limitation. It's really annoying, I agree.

I reported this issue to kde devs, while they thought this was an electron issue.

@Yasand123
Copy link

Has to be a KDE issue. When I used GNOME in the past Electron apps had borders and window shadows like other GNOME apps. You can even control the border radius via plugins. So it's a KDE limitation. It's really annoying, I agree.

I reported this issue to kde devs, while they thought this was an electron issue.

KDE Plasma presents users with two primary options for window decorations: either utilizing the complete native window decorations stack or relying on the application's internal decoration. In contrast, GNOME offers a third option, where a border and shadows can be applied around a window irrespective of whether it has native or built-in decorations. This feature extends beyond Electron-based applications to include any displayed window, such as Steam. Steam is not an Electron app.

It's unclear why KDE developers are saying this is an Electron issue. There seems to be an expectation by them for Electron apps to implement their own non-native borders, simulating the appearance of native borders. However, this aligns more with theming, and any changes to native borders would not apply to Electron apps in this case since it would be fixed. As far as I know, window managers like KWin should have the capability to apply native borders around any window, which is what GNOME does with Mutter.

@detiam
Copy link

detiam commented Jan 19, 2024

Has to be a KDE issue. When I used GNOME in the past Electron apps had borders and window shadows like other GNOME apps. You can even control the border radius via plugins. So it's a KDE limitation. It's really annoying, I agree.

I reported this issue to kde devs, while they thought this was an electron issue.

KDE Plasma presents users with two primary options for window decorations: either utilizing the complete native window decorations stack or relying on the application's internal decoration. In contrast, GNOME offers a third option, where a border and shadows can be applied around a window irrespective of whether it has native or built-in decorations. This feature extends beyond Electron-based applications to include any displayed window, such as Steam. Steam is not an Electron app.

It's unclear why KDE developers are saying this is an Electron issue. There seems to be an expectation by them for Electron apps to implement their own non-native borders, simulating the appearance of native borders. However, this aligns more with theming, and any changes to native borders would not apply to Electron apps in this case since it would be fixed. As far as I know, window managers like KWin should have the capability to apply native borders around any window, which is what GNOME does with Mutter.

but on wayland mutter, the electron app and steam lost border and shadows too, seems in new wayland world mutter think the same way as plasma now.

btw there a work-round for plasma, you can force system-side decoration enable for specific app in kwin rules, then hide window title bar for specific app in window decoration settings (the reddit post)

@Yasand123
Copy link

Has to be a KDE issue. When I used GNOME in the past Electron apps had borders and window shadows like other GNOME apps. You can even control the border radius via plugins. So it's a KDE limitation. It's really annoying, I agree.

I reported this issue to kde devs, while they thought this was an electron issue.

KDE Plasma presents users with two primary options for window decorations: either utilizing the complete native window decorations stack or relying on the application's internal decoration. In contrast, GNOME offers a third option, where a border and shadows can be applied around a window irrespective of whether it has native or built-in decorations. This feature extends beyond Electron-based applications to include any displayed window, such as Steam. Steam is not an Electron app.
It's unclear why KDE developers are saying this is an Electron issue. There seems to be an expectation by them for Electron apps to implement their own non-native borders, simulating the appearance of native borders. However, this aligns more with theming, and any changes to native borders would not apply to Electron apps in this case since it would be fixed. As far as I know, window managers like KWin should have the capability to apply native borders around any window, which is what GNOME does with Mutter.

but on wayland mutter, the electron app and steam lost border and shadows too, seems in new wayland world mutter think the same way as plasma now.

btw there a work-round for plasma, you can force system-side decoration enable for specific app in kwin rules, then hide window title bar for specific app in window decoration settings (the reddit post)

Ok, so this makes me wonder even more what they mean by saying it's an Electron issue... I just did it and it worked exactly like you'd want/expect. Thanks for sharing this btw, it's so hidden you'd not think it exists at all. This needs to be more streamlined and maybe enabled by default for all apps that use client side decorations.

@detiam
Copy link

detiam commented Jan 19, 2024

This needs to be more streamlined and maybe enabled by default for all apps that use client side decorations.

@Yasand123 Probably not, the csd app on your computer maybe more than you thought, actually almost all app that don't have system title bar is a csd app. firefox, telegram, all gtk app, and even chrome.
If you apply work-round to above normal well-code csd app, it will unexpectedly have two borders:
firefox that applied the work-round
most other csd app drawn client-side border and shadows themselves, even electron's upstream chromium, but Electron don't. This why kde team says it's an Electron issue. there have two solutions for this issue:

  1. Fix it on Electron side, draw client-side border and shadows itself as it's upstream chromium.
  2. kwin do some idk hacking to get the same behavior as mutter in X world.

I don't have expectation on 1. because MS maybe love Linux but definitely not love Windows competitor KDE and Gnome, prepare for wait another 7 years for this to get fixed.
And I don't have expectation on 2. too, because why kwin will restore the old behavior of mutter after mutter drop this behavior now?

@electron-issue-triage
Copy link

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!

@wen-zheng
Copy link

bump

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

No branches or pull requests

6 participants