Bug 499367

Summary: Applications open on primary display when mouse is on second display
Product: [Plasma] kwin Reporter: John <john1234321nhoj>
Component: multi-screenAssignee: KWin default assignee <kwin-bugs-null>
Status: REPORTED ---    
Severity: normal CC: kdedev, mira.jary, nate, xaver.hugl
Priority: NOR Keywords: multiscreen
Version First Reported In: 6.2.5   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot of the window settings

Description John 2025-01-31 19:34:11 UTC
SUMMARY
Incorrect screen and window focus and window placement on multi monitor setup.

STEPS TO REPRODUCE
1. Connect secondary monitor
2. (Optionally) open any program (for example Firefox) and move it on the secondary monitor
3. Move/keep the mouse cursor on the secondary monitor
4. Click meta key to open Application Launcher*
5. Choose any program using arrow keys and click enter

* Application Launcher and the task bar are present only on the primary monitor.

OBSERVED RESULT
The window opens on the primary monitor.

If you start moving the mouse shortly after clicking enter, the window opens on the correct screen.

Also, if you only open and close the Application Launcher by clicking meta key twice, it makes the primary monitor (the one with Application Launcher and a window on this screen (if present)) focused/active.

EXPECTED RESULT
The window is always being opened on the screen where the mouse cursor is present.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Kali GNU/Linux 2024.4
KDE Plasma Version: 6.2.5
KDE Frameworks Version: 6.10.0
Qt Version: 6.7.2

ADDITIONAL INFORMATION
Kernel Version: 6.11.2-amd64 (64-bit)
Graphics Platform: Wayland
Kali Rolling with installed all the available updates.

The bug was also present on Plasma 6.2.4, but not on 5.27.11.
Comment 1 John 2025-01-31 19:41:59 UTC
CPU: Intel Core i7-1255U with Iris Xe graphics.
The secondary monitor is connected via HDMI cable.
Comment 2 John 2025-02-19 21:48:17 UTC
Unfortunately, it's still present in 6.3.0.
Comment 3 TraceyC 2025-02-24 22:52:02 UTC
I'm able to reproduce this on X11 git-master using a laptop as the primary display and an external monitor as a second display
This may be intentional behavior, depending on the focus settings

Can you attach a screenshot of the window
System Settings - Window Behavior - Focus tab

Also, resetting the Version field. Please don't change this. Thanks.
Comment 4 John 2025-02-28 18:30:28 UTC
Created attachment 178976 [details]
Screenshot of the window settings

I've been testing some options for a while and I looked more carefully and noticed that in 5.27.5 (Debian 12) the behavior is very similar.
So now I'm not sure how it was in 5.27.11 on Kali, because I updated Plasma in late Dec 2024/early Jan 2025.


But then I disabled the last option (see the screenshot), and it works better now, but I noticed another problem:

STEPS TO REPRODUCE
1. Connect secondary monitor
2. Set Windows activation policy to "Click to focus (mouse precedence)"
3. Disable "Separate screen focus"
4. Open any program (for example Firefox) on the primary monitor
5. Keep the mouse cursor on the same monitor
6. Click meta key to open Application Launcher*
7. Choose any program using arrow keys
8. Move the mouse on the secondary monitor
9. Click enter to run the program

* Application Launcher and the task bar are present only on the primary monitor.

OBSERVED RESULT
Plasma 6.2.5: The new window is opened on the primary monitor (wrong).

Plasma 5.27.5: The new window is opened on the secondary monitor (as expected, but
this version was tested on my PC with RX 6700 XT and two 1920x1200 monitors connected via DP).

EXPECTED RESULT
The window is always being opened on the screen where the mouse cursor is present (on the secondary monitor in this case).



But when you do it the other way around, it works as expected:
STEPS TO REPRODUCE
1. Connect secondary monitor
2. Set Windows activation policy to "Click to focus (mouse precedence)"
3. Disable "Separate screen focus"
4. Open any program (for example Firefox) and move it on the secondary monitor
5. Move/keep the mouse cursor on the secondary monitor
6. Click meta key to open Application Launcher*
7. Choose any program using arrow keys
8. Move the mouse on the primary monitor
9. Click enter to run the program

* Application Launcher and the task bar are present only on the primary monitor.

OBSERVED RESULT
Window opens on the primary monitor (as expected in both Plasma 5.27.5 and 6.2.5).
Comment 5 Bug Janitor Service 2025-03-15 03:47:30 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 6 Zamundaaa 2025-07-18 13:02:55 UTC
*** Bug 506915 has been marked as a duplicate of this bug. ***
Comment 7 Miroslav Jarý 2025-11-04 12:16:08 UTC
Can confirm this is still an issue in Plasma 6.5.1

Operating System: Arch Linux 
KDE Plasma Version: 6.5.1
KDE Frameworks Version: 6.19.0
Qt Version: 6.10.0
Kernel Version: 6.17.6-zen1-1-zen (64-bit)
Graphics Platform: Wayland
Processors: 12 Ɨ 13th Gen IntelĀ® Coreā„¢ i5-13420H
Memory: 32 GiB of RAM (31,1 GiB usable)
Graphics Processor 1: Mesa IntelĀ® Graphics
Graphics Processor 2: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2
Manufacturer: LENOVO
Product Name: 82XV
System Version: LOQ 15IRH8