| Summary: | On NixOS, notifications, OSDs, and KRunner appear in task manager and steal focus | ||
|---|---|---|---|
| Product: | [Plasma] kwin | Reporter: | Peter Hoeg <peter> |
| Component: | wayland-generic | Assignee: | KWin default assignee <kwin-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | minor | CC: | andre.vmatos, bharadwaj.raju777, iam, kde, kde, nate, p3dimaria |
| Priority: | NOR | ||
| Version First Reported In: | 5.22.4 | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Logs from `WAYLAND_DEBUG=1 krunner --replace` | ||
|
Description
Peter Hoeg
2021-04-06 10:14:29 UTC
Are they in the wrong position too? I have set my notifications to appear in the bottom right of the left screen with a vertical panel on the left. The notifications appear as expected. The krunner pop-down also appears correctly from the top (haven't tried with the floating krunner). But now that you mention it, I do remember seeing a few other popups (like the volume) control showing in the top left, where they definitely didn't belong. When I mention notifications, I mean the ones you can send with `notify-send` - they are the biggest issue due to the focus steal. Any suggestions as to where to start digging to find out what is causing this? I am not at all asking for anyone to do the actual work - it would just be super helpful with some pointers regarding where to start looking considering I'm not at all familiar with the plasma code. Also found this which sounds like it could be related: https://community.kde.org/Plasma/Notifications#DesktopEntry_in_notifyrc (In reply to Peter Hoeg from comment #4) > Also found this which sounds like it could be related: > > https://community.kde.org/Plasma/Notifications#DesktopEntry_in_notifyrc I don't think it is. The desktop entry stuff is only used to provide per-app notification settings, proper icon, etc. It shouldn't have any bearing on how notification popups are treated by the WM. For debugging, try: 1. Set notification popup timeout to some long value 2. Get a notification (eg using notify-send) 3. Open System Settings > Window Management > Window Rules 4. Click Add New, then click Detect Window Properties 5. Now click on the notification popup This way you can see the various hints and flags set on the window (like Skip Taskbar, etc). This should be helpful. As for the code, I believe it is in https://invent.kde.org/plasma/plasma-workspace/-/blob/master/applets/notifications/package/contents/ui/NotificationPopup.qml, and other files in the vicinity. Thanks for the details. Work continues on the mentioned github issue - it has to do with the window class and how we wrap things on NixOS. Can you provide the output of WALYAND_DEBUG=1 krunner --replace in the case where it appears in the taskmanager? Created attachment 139257 [details]
Logs from `WAYLAND_DEBUG=1 krunner --replace`
OSDs (IME, volume) is in wrong position (top left, but not overlapping taskbar) and stealing focus too I've made further progress investigating it in https://github.com/NixOS/nixpkgs/issues/118650#issuecomment-895582456 In particular, I've found that notifications and OSD have window type "Normal window" and their name is "org.kde.plasmashell", while their entire class is ".plasmashell-wrapped.org.kde.plasmashell". Note that ".plasmashell-wrapped" is the name of the actual plasmashell executable on NixOS."plasmashell" is merely a shell wrapper setting a few env vars correctly before execing it. However we already patched service_utils.h to account for it https://github.com/NixOS/nixpkgs/blob/7db379d016a9bad7b7da9b81103ab7454faa3344/pkgs/desktops/plasma-5/kwin/0001-NixOS-Unwrap-executable-name-for-.desktop-search.patch I've also found that window type on X11 (where everything work as expected) is empty for notifications. I can confirm this bug on NixOS, latest plasma5 5.22.5 & kf5.86. Interesting is that, even adding a very broad KWin rule for any type of window with Window class containing a substring of "org.kde.plasmashell" (detected properties) and forcing it to Skip taskbar and Extreme Window focus stealing prevention doesn't work, notifications still show up in taskbar and focus is stolen. Only on Wayland. |