Bug 401581 - Win+P still assumes the monitors position wrongly, ignoring the Display Configuration.
Summary: Win+P still assumes the monitors position wrongly, ignoring the Display Confi...
Status: RESOLVED FIXED
Alias: None
Product: KScreen
Classification: Plasma
Component: common (other bugs)
Version First Reported In: 5.24.2
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-11-30 17:05 UTC by Sin Jeong-hun
Modified: 2022-10-07 11:06 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sin Jeong-hun 2018-11-30 17:05:18 UTC
SUMMARY

MonitorL is on the left, MonitorR is on the right. However, the graphics card arbitarily assigns Display1 to the right monitor, and Display2 on the left monitor, and this cannot be changed. I can switch the positions and set MonitorL (which is Display2) as the primary monitor in Display Configuration, yet Win+P still thinks that MonitorR is on the left, MonitorL is on the right, and shows "Extend to left/right" wrongly. 

Moreover, when the primary display has been set to MonitorL (Display2), if I disable MonitorR by selecting "Switch to external screen" and then re-enable it by selecting "Extend to left", the primary monitor is changed to MonitorR (Display1). 

STEPS TO REPRODUCE
1. Connect two monitors to your computer.
2. Purposely position the monitor that the graphics card think the first monitor on the right.
3. Change monitor positions in Display Settings, and set the physical left monitor as the primary monitor.
4. Press Win+P to disable the right monitor and re-enable it.

OBSERVED RESULT
Win+P assumes the positions wrongly. Disable/re-enabling Diplay1 moves the primary monitor from Display2 to Display1.

EXPECTED RESULT
Win+P should respect the actual positions that is set in Display Settings. The primary monitor should be remembered (Windows does, for the same situation).

SOFTWARE/OS VERSIONS
Windows: 
MacOS: 
Linux/KDE Plasma: Manjaro (Kernel 4.19.4.1) but also happens in Ubuntu 18.10
KDE Plasma Version: 5.14.3
KDE Frameworks Version: 5.52.0
Qt Version: 5.11.2

ADDITIONAL INFORMATION
Comment 1 luca.de.martini 2021-12-02 20:10:03 UTC
This is still broken in plasma 5.22.5

Also, the problem is not only limited to the display position, but the primary display is also forgotten!
The two displays are Display port and HDMI and the HDMI one is always set as primary in my case.

This is really annoying and broken since forever
Comment 2 micheleoro.nobili 2022-02-27 13:32:54 UTC
Still present in 5.24.2. It is really annoying.
Luckly with a fast search on reddit you can see that everyone is overcoming the issue setting a personal script with help from arandr and/or xrandr. 
But really the solution at the moment is to disable kscreen and setting up a personal script. A fix to kscreen would be welcome.
Comment 3 micheleoro.nobili 2022-02-27 14:01:57 UTC
To add some information on the issue:
 
I have display A (HDMI-1) and B (HDMI-0). Both connected with HDMI.
A is my main monitor,  B is my television. B is always connected but I only enable it (extend) when seeing something.
Whenever I use kscreen (default Meta+P) to extend (to the right*) the primary monitor change to display B. I don't want that. A should always be my Primary. So I open the display configuration, set everything right (primary/position/etc..). Then if I disable the B screen (Meta+P and select external monitor) and then I want to re-enable the B monitor (Meta+P and extend to the right) I am at the starting point again. Like if kscreen never encountered the B monitor before.

In ~/.local/share/kscreen/outputs I see that there two files (file names are something like "e51393b4fa33a19dd6987077f0efcdcf") that store the information of my two displays. So kscreen is able to recognize them.
In ~/.local/share/kscreen/ there are two files with the configuration for single monitor and extended monitor. When I correct the primary monitor in the display configuration the file (the dual monitor one) is updated and correctly says which one is the primary. 
But then it seems that if I revert to single monitor and re enable the extended layout kscreen simply delete all the informations and recreate the file from zero. 

I see that when checking the option " For only this display arrangement " in the display configuration  a new file is created inside ~/.local/share/kscreen/control/configs. 
This file has the same name of the file in ~/.local/share/kscreen/ that store my current dual monitor configuration, but a lot less informations.
Is it possible that it should save the current configuration to reuse it later when I connect/change active displays?
For sure in that file the "primary" setting is not saved. I tried to set it myself but that didn't work too. It seems to be completely ignored.


----------------------------------------------------------------------------------------------------
*BTW: the extend to the left and to the right seems only useful when connecting for the first time to a display for the first time. Is it really that useful? Chance are that on the first time you will have to enter display configuration to set resolution anyway. And after the first time if kscreen works correctly it should remember the display and extend correctly.
Comment 4 Allan Sandfeld 2022-10-07 09:37:22 UTC
I believe I have fixed that with my recent patch. It will now extend from the primary screen, and not change primary screeen.

As far as I know the fix will be in 5.27..

Reopen if this isnt a sufficient solution.
Comment 5 rasmus.oltrogge 2022-10-07 11:06:52 UTC
Very similar to 376341 and 396071.
Anyhow, I say, this should even be put into the #15-minute-initiative