Bug 427069

Summary: [wayland] Krunner starts on the left-most screen instead of screen with the cursor on it
Product: [Plasma] krunner Reporter: bartek1516
Component: generalAssignee: Kai Uwe Broulik <kde>
Status: RESOLVED FIXED    
Severity: normal CC: 1i5t5.duncan, alexander.lohnau, alexander.reimelt, indecisiveautomator, jdkatz23, justin.zobel, kde, KVAnton.WEB, lukas, mail, mikaela.szekely, mistry01, nate, philipp.reichmuth, plasma-bugs, qlumreg, rushpl, smit17xp, vsafonin, zellox
Priority: NOR Keywords: multiscreen, wayland
Version: 5.23.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
See Also: https://bugs.kde.org/show_bug.cgi?id=397066
Latest Commit: Version Fixed In: 5.25
Sentry Crash Report:

Description bartek1516 2020-09-28 13:29:31 UTC
SUMMARY
In my 3 monitor setup Krunner starts always on most left screen doesn't matter where the mouse is.

STEPS TO REPRODUCE
1. Press alt+space

OBSERVED RESULT
Krunner starts on most left screen

EXPECTED RESULT
Krunner should start on the current screen(where mouse is).

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
(available in About System)
KDE Plasma Version: 5.19.90
KDE Frameworks Version: 5.74.0
Qt Version: 5.15.1

ADDITIONAL INFORMATION
Comment 1 Alexander 2020-10-17 09:24:19 UTC
Same on 5.20 krunner is always on the secondary screen no matter what. I enabled active screen follows mouse but I can have an active window and cursor on my main laptop screen and krunner will still open on the inactive second screen.

Operating System: openSUSE Tumbleweed 20201014
KDE Plasma Version: 5.20.0
KDE Frameworks Version: 5.75.0
Qt Version: 5.15.1
Kernel Version: 5.8.14-1-default
OS Type: 64-bit
Processors: 8 × AMD Ryzen 7 2700U with Radeon Vega Mobile Gfx
Memory: 15.3 GiB of RAM
Graphics Processor: AMD RAVEN
Comment 2 Justin Zobel 2020-11-22 04:10:10 UTC
Confirmed on KDE Neon User Edition.

Plasma 5.20.3 / KF 5.75.0 / Qt 5.15.1
Comment 3 Alexander Lohnau 2020-11-24 15:15:58 UTC
Confirmed, this is one of the wayland difficulties.
Comment 4 smit 2021-08-27 16:18:03 UTC
It was working fine for me in x11 session. Then I tried Wayland session and now this also happens in X11 session.
It always open in top left corner of left monitor
Comment 5 smit 2021-08-31 15:20:50 UTC
Is this kwin bug ?
Because krunner open correctly on correct monitor (which has mouse pointer) under swaywm
Comment 6 Anton K 2021-10-16 19:31:21 UTC
Confirmed

Operating System: KDE neon 5.23
KDE Plasma Version: 5.23.0
KDE Frameworks Version: 5.87.0
Qt Version: 5.15.3
Comment 7 Anton K 2021-10-16 19:34:02 UTC
(In reply to smit from comment #5)
> Is this kwin bug ?
> Because krunner open correctly on correct monitor (which has mouse pointer)
> under swaywm

Yes, it seems this is kwin, I have the same problem with the Telegram
Comment 8 Damian Kaczmarek 2021-12-27 06:58:38 UTC
Couldn't kwin track the current active screen and expose it via dbus? No need for any super complicated solution
Comment 9 Dmitry Misharov 2022-02-08 18:24:20 UTC
Plasma 5.24 introduced "primary screen" conception for Wayland session. Would krunner just follow the same logic as in X11 session?
Comment 10 Kishore Gopalakrishnan 2022-03-27 11:32:44 UTC
*** Bug 451795 has been marked as a duplicate of this bug. ***
Comment 11 Kishore Gopalakrishnan 2022-03-27 11:33:50 UTC
*** Bug 445157 has been marked as a duplicate of this bug. ***
Comment 12 Kishore Gopalakrishnan 2022-03-27 11:38:55 UTC
*** Bug 448572 has been marked as a duplicate of this bug. ***
Comment 13 Duncan 2022-03-27 17:48:06 UTC
*** Bug 429177 has been marked as a duplicate of this bug. ***
Comment 14 Nate Graham 2022-04-07 21:26:52 UTC
Git commit 3521631bbb83ce20bf8c4c679f33a87a31b5c98b by Nate Graham, on behalf of Martin Seher.
Committed on 07/04/2022 at 21:26.
Pushed by ngraham into branch 'master'.

Add activeOutputName to DBus interface

Provide the name of the active output via the DBus interface, so it can
be used by other components, like KRunner (see bug 427069).

M  +6    -0    src/dbusinterface.cpp
M  +1    -0    src/dbusinterface.h
M  +3    -0    src/org.kde.KWin.xml

https://invent.kde.org/plasma/kwin/commit/3521631bbb83ce20bf8c4c679f33a87a31b5c98b
Comment 15 Nate Graham 2022-04-07 21:28:15 UTC
Git commit 4150506920a34c937de1e79768c8132912c56041 by Nate Graham, on behalf of Martin Seher.
Committed on 07/04/2022 at 21:28.
Pushed by ngraham into branch 'master'.

Show krunner on active output on Wayland

QCursor::pos does not work under Wayland. So use active output from KWin to
determine startup screen. This will also honor the 'Active screen follows
mouse' option from Window Behavior (also under X11).

Depends on KWin merge request https://invent.kde.org/plasma/kwin/-/merge_requests/2209
FIXED-IN: 5.25

M  +12   -1    krunner/view.cpp

https://invent.kde.org/plasma/plasma-workspace/commit/4150506920a34c937de1e79768c8132912c56041