SUMMARY This is most probably not a kwin bug per se, but rather a consequence of how things on NixOS are quite different from other distributions. The problem we are seeing with wayland is that notifications and krunner are treated as first-class windows and therefore appear in the task manager (not a big issue) and also take focus (very annoying with notifications). There are not errors in the journal that to shed any light on this. It's probably because nixos is different, so any pointers to where to look would be much appreciated. STEPS TO REPRODUCE 1. Install latest nixos unstable 2. Run plasma wayland 3. Trigger krunner (or wait for a notification to appear) OBSERVED RESULT Notice an icon in the task manager or the focus being on a notification. EXPECTED RESULT Notifications should not have focus and not appear in the task manager. SOFTWARE/OS VERSIONS Linux: 5.11.10 KDE Plasma Version: 5.21.3 KDE Frameworks Version: 5.79 (5.80 will be arriving shortly and then tested as well - I will update this ticket then) Qt Version: 5.15.2 ADDITIONAL INFORMATION https://github.com/NixOS/nixpkgs/issues/118650
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.