Bug 469090 - After screen is dim or switch off, primary becomes laptop internal monitor.
Summary: After screen is dim or switch off, primary becomes laptop internal monitor.
Status: RESOLVED DUPLICATE of bug 466149
Alias: None
Product: plasmashell
Classification: Plasma
Component: generic-multiscreen (show other bugs)
Version: 5.27.4
Platform: Ubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-04-28 05:51 UTC by zyf0330
Modified: 2023-05-18 15:51 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
attachment-1272780-0.html (1.63 KB, text/html)
2023-05-03 05:08 UTC, zyf0330
Details
kscreen-doctor -o output (480.89 KB, image/png)
2023-05-08 07:58 UTC, zyf0330
Details
Tilix Quake monitor setting (55.30 KB, image/png)
2023-05-18 05:59 UTC, zyf0330
Details

Note You need to log in before you can comment on or make changes to this bug.
Description zyf0330 2023-04-28 05:51:43 UTC
SUMMARY
***
NOTE: If you are reporting a crash, please try to attach a backtrace with debug symbols.
See https://community.kde.org/Guidelines_and_HOWTOs/Debugging/How_to_create_useful_crash_reports
***

My laptop has dual-monitors, one is laptop internal monitor, one is external monitor connected by HDMI as primary screen.
I set dim and switch off strategy in the Advanced Power Settings. And after lunch break in which I doesn't touch my laptop, when I use laptop, I find that krunner appears at the internal monitor screen, and popup window of WebStorm appears at the internal monitor screen too.
I check Display Configuration, and primariy monitor setting is still external monitor. And I must change it to internal monitor and apply and then change back to external monitor and apply, to make krunner and popup window appearing at the external monitor.

STEPS TO REPRODUCE
1. not be sure how to into this situation

OBSERVED RESULT
The krunner and popup window of WebStorm appear at the laptop internal monitor screen, which is not primary screen.

EXPECTED RESULT
The krunner and popup window of WebStorm appear at the external HDMI connected monitor screen, which is primary screen by Display Configuration Setting.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Ubuntu with KDE
(available in About System)
KDE Plasma Version: 5.27.4
KDE Frameworks Version: 5.104.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
use X11
Comment 1 Nate Graham 2023-04-28 18:58:08 UTC
When this happens, can you move the mouse pointer onto the area the disabled screen occupied? Or is it stuck on the laptop screen?

When this happens, can you run `kscreen-doctor -o` in a terminal window and paste the output?
Comment 2 zyf0330 2023-05-03 05:08:53 UTC
Created attachment 158643 [details]
attachment-1272780-0.html

These two screens work normally for everything, just the primary screen is
switched to another one.

On Sat, Apr 29, 2023, 02:58 Nate Graham <bugzilla_noreply@kde.org> wrote:

> https://bugs.kde.org/show_bug.cgi?id=469090
>
> Nate Graham <nate@kde.org> changed:
>
>            What    |Removed                     |Added
>
> ----------------------------------------------------------------------------
>              Status|REPORTED                    |NEEDSINFO
>                  CC|                            |nate@kde.org
>          Resolution|---                         |WAITINGFORINFO
>
> --- Comment #1 from Nate Graham <nate@kde.org> ---
> When this happens, can you move the mouse pointer onto the area the
> disabled
> screen occupied? Or is it stuck on the laptop screen?
>
> When this happens, can you run `kscreen-doctor -o` in a terminal window and
> paste the output?
>
> --
> You are receiving this mail because:
> You reported the bug.
Comment 3 Nate Graham 2023-05-05 09:11:35 UTC
Thanks.

When this happens, can you run `kscreen-doctor -o` in a terminal window and paste the output?
Comment 4 zyf0330 2023-05-08 07:58:34 UTC
Created attachment 158760 [details]
kscreen-doctor -o output
Comment 5 Nate Graham 2023-05-14 18:36:37 UTC
According to KScreen, the external screen is still the primary one. So that doesn't seem to be the issue.

There also seems to be some confusion; KRunner doesn't follow the primary screen. It will appear on the *active* screen, with "active" being defined as "the screen with the cursor on it".

So that leaves the issue with WebStorm. Can you paste the output of the `xrandr` command when this happens?
Comment 6 zyf0330 2023-05-15 02:06:49 UTC
I forgot to mention one thing. I have create a window rule to force KRunner is placed at screen 0.
Comment 7 zyf0330 2023-05-18 05:48:17 UTC
This is xrandr output
```
Screen 0: minimum 320 x 200, current 4480 x 1440, maximum 16384 x 16384
eDP connected primary 1920x1200+0+120 (normal left inverted right x axis y axis) 301mm x 188mm
   2880x1800     90.01 +
   1920x1200     90.01* 
   1920x1080     90.01  
   1600x1200     90.01  
   1680x1050     90.01  
   1280x1024     90.01  
   1440x900      90.01  
   1280x800      90.01  
   1280x720      90.01  
   1024x768      90.01  
   800x600       90.01  
   640x480       90.01  
HDMI-A-0 connected 2560x1440+1920+0 (normal left inverted right x axis y axis) 597mm x 336mm
   2560x1440     59.95*+
   1920x1200     59.95  
   1920x1080     60.00    50.00    59.94  
   1600x1200     59.95  
   1280x1440     59.91  
   1680x1050     59.88  
   1280x1024     75.02    60.02  
   1440x900      59.90  
   1280x960      60.00  
   1280x800      59.95  
   1280x720      60.00    50.00    59.94  
   1024x768      75.03    70.07    60.00  
   832x624       74.55  
   800x600       72.19    75.00    60.32    56.25  
   720x576       50.00  
   720x480       60.00    59.94  
   640x480       75.00    72.81    66.67    60.00    59.94  
   720x400       70.08  
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
DisplayPort-1 disconnected (normal left inverted right x axis y axis)
DisplayPort-2 disconnected (normal left inverted right x axis y axis)
DisplayPort-3 disconnected (normal left inverted right x axis y axis)
DisplayPort-4 disconnected (normal left inverted right x axis y axis)
DisplayPort-5 disconnected (normal left inverted right x axis y axis)
DisplayPort-6 disconnected (normal left inverted right x axis y axis)
```
Comment 8 zyf0330 2023-05-18 05:59:41 UTC
Created attachment 159062 [details]
Tilix Quake monitor setting

Another thing, I have set Tilix Quake to display on Primary Monitor. And after this problem appears, Tilix Quake window appears on laptop monitor which is set as non-primary monitor.
And if I set it to display on Monitor 0, it still displays on laptop monitor. If I set as Monitor 1, it displays on external primary monitor.

So I can guess that when this problem occurs, monitor 0 and 1 is swapped.

This is config in the .config/plasmashellrc.
```
[ScreenConnectors]
0=HDMI-A-0
1=eDP
```
Comment 9 Nate Graham 2023-05-18 15:51:50 UTC
I think the problem is that the xrandr output says:

> eDP connected primary

But Plasma and KScreen think the external screen is primary.

So they don't agree, which means XWayland apps that use xrandr to determine primary-ness will use the wrong screen. That makes this the same issue as Bug 466149.

*** This bug has been marked as a duplicate of bug 466149 ***