Bug 491251

Summary: Apps open on wrong display depending on mouse cursor movement and launch method
Product: [Plasma] kwin Reporter: bllcha013
Component: multi-screenAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: cerebroso, fanzhuyifan
Priority: NOR    
Version First Reported In: 6.1.3   
Target Milestone: ---   
Platform: Arch Linux   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description bllcha013 2024-08-04 10:16:18 UTC
SUMMARY

I have 2 displays - a primary 4K @ 200% scaling (DisplayPort), and a secondary 1080p @ 100% scaling (HDMI), using Wayland.

When no apps are open, or all app windows on the primary display are minimized, opening a new app window from the Application Menu or KRunner results in the app window appearing on the secondary display, even though the mouse cursor was placed on the primary display during app launch, but only if the mouse cursor is not moved after opening the app. If you move the mouse cursor immediately after clicking the app, it will launch on the correct display. If an existing app is open and visible (not minimized) on the primary display, the app will launch on the correct display regardless of mouse cursor movement. Launching apps from the panel Task Manager shows correct behavior regardless of mouse cursor movement or existing visible app windows.

Even entering "Edit mode" by right-clicking the desktop, and clicking "Display Configuration" for example, without moving the mouse (keep it dead-still) results in the window opening on the incorrect (secondary) display.

STEPS TO REPRODUCE
1. Set up 2 monitors, one primary at 200% scaling and one secondary at 100% scaling.
2. Close all app windows.
3. On the primary 200% scaling display, use the Application Menu or KRunner to launch an app such as Dolphin or Konsole, but do not move the mouse after clicking (hold the mouse dead-still during/after the click).
4. Observe the app window opening on the incorrect display.
5. Close all app windows and try launching again, but this time move the mouse cursor constantly just after clicking.
6. Observe the app window opening on the correct display (the one the mouse cursor is moving around on).

SOFTWARE/OS VERSIONS
Linux: 6.10.2-arch1-2 Arch Linux (up-to-date as of August 4, 2024)
KDE Plasma Version: 6.1.3 (Arch package plasma-desktop 6.1.3-1)
Qt Version: 6.7.2 (Arch package qt6-wayland 6.7.2-4)

ADDITIONAL INFORMATION

I am using an AMD Radeon R9 390X (Hawaii) GPU with amdgpu driver, Mesa, RADV Vulkan. The secondary display is configured to be to the left of the primary display. XWayland apps are set to "Apply scaling themselves".

There is another multi-monitor bug that affects some apps (such as LibreOffice), with LibreOffice using incorrect scaling depending on the order of monitor wake-up/connection (it will use the scaling value from the first connected display regardless of Plasma/KScreen settings, only replugging monitors in the correct order resolves the issue). But I assume this should be a separate bug report from this one, as I am not sure if they are related.
Comment 1 fanzhuyifan 2024-08-04 17:26:17 UTC
What are your settings in window management - window behavior - focus?
Comment 2 bllcha013 2024-08-05 07:50:08 UTC
(In reply to fanzhuyifan from comment #1)
> What are your settings in window management - window behavior - focus?

They are the defaults:

Window activation policy: Click to focus
Delay focus by: 300 ms
Focus stealing prevention: Low
Raising windows: [ON] Click raises active window
                                [OFF] Raise on hover
Multiscreen behavior: [OFF] Separate screen focus
Comment 3 Bug Janitor Service 2024-08-20 03:47:32 UTC
๐Ÿ›๐Ÿงน โš ๏ธ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 4 Ravi 2024-10-09 02:36:18 UTC
I have the exact same problem. It's been happening for a while. I'm on plasma 6.2 now, but I think it's been happening since before 6.1.
I have all default options (click to focus etc). My primary screen is to the right of the secondary screen, both with the same scale (125%). Using wayland