Bug 448969

Summary: [Dualmonitor] After plugging DisplayPort monitor back in: Windows switched monitors and graphical issues
Product: [Plasma] kwin Reporter: postix <postix>
Component: wayland-genericAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: nate, postix
Priority: NOR Keywords: wayland-only
Version First Reported In: 5.23.90   
Target Milestone: ---   
Platform: Neon   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Screenshot
Screenshot: After minimizing and restoring the Systemsettings window
Screenshot: Afte turning off and back on the TV
KWin support information (DP + HDMI attached)

Description postix 2022-01-22 19:16:07 UTC
Created attachment 145765 [details]
Screenshot

SUMMARY

As you can see in the screenshot, on the left monitor there's the Firefox window and the panel and on the right TV (HDMI) there's the Systemsettings.
Originally, the Firefox window was on the right (TV) and the Systemsettings on the left (DP monitor):

STEPS TO REPRODUCE
1.  Plasma Wayland, 200% scaling, DisplayPort monitor
2.  Attach a TV to the HDMI port and expand the screen to the right
3. Open the Systemsettings and the Firefox on the DisplayPort monitor, move the latter to the TV (maximized)
4.  Disconnect the DisplayPort cable

OBSERVED RESULT
The panel moved to the TV, everything looked fine.

STEPS TO REPRODUCE
5.  Connect the DisplayPort again

OBSERVED RESULT
The panel moved back to the DisplayPort monitor, as expected.
However, the Firefox window moved from the TV to the Display monitor as well and Systemsettings window moved in the other direction from the DisplayPort monitor to the TV.
Also the background wallpaper on the TV vanished and there are graphical artifacts (black bars) on the Systemsettings window.

EXPECTED RESULT
Systemsettings on the DisplayPort monitor, Firefox on the TV, no-gone wallpaper and no graphical glitches.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: KDE Neon Testing
KDE Plasma Version: 5.23.90
KDE Frameworks Version: 5.91.0
Qt Version: 5.15.3

ADDITIONAL INFORMATION
Wayland
DisplayPort Monitor: 3840x2160@200%
TV: 1920x1080@100%
Comment 1 postix 2022-01-22 19:30:05 UTC
Created attachment 145766 [details]
Screenshot: After minimizing and restoring the Systemsettings window

After minimizing and restoring the Systemsettings window, at least the graphical glitches on this particular window were gone.
Comment 2 postix 2022-01-22 19:32:42 UTC
Created attachment 145768 [details]
Screenshot: Afte turning off and back on the TV

After turning off and back on the TV, all windows were on the DisplayPort monitor and the background wallpaper of the TV reappeared. However, the Systemsettings window was rendered at a lower resolution.

All this is easily reproducible for me. If you need specific logs, please let me know, so I can provide you with everything you need to fix these last papercuts. :)
Comment 3 Nate Graham 2022-01-23 21:11:27 UTC
> Also the background wallpaper on the TV vanished
That's a separate issue, likely Bug 371717.
Comment 4 postix 2022-01-24 20:32:02 UTC
Created attachment 145880 [details]
KWin support information (DP + HDMI attached)
Comment 5 postix 2022-01-24 20:38:13 UTC
Today, with the latest updates, I can no longer reproduce the graphical artifacts, nor the gone containment.  Just, when unplugging all the HDMI, all windows go to the DP and stay there even after plugging the HDMI back in. However, when the Systemsettings was on the low res HDMI monitor before, it's rendered in lower resolution after plugging out the HDMI monitor. I will open a new bug report for that.