I recently got a secondary monitor. My problem is, that even when it’s turned off, I am still able to move my mouse to the secondary display or drag windows to it.
I know that I could manually enable / disable the monitor but that’s too much work to do every time:
As far as I know I want the same behavior as on Windows e.g. when you turn off your secondary monitor all your windows and desktop icons get moved to the first one and you are not able to move your mouse to it anymore.
I am running KDE Plasma Wayland.
(Also is this a bug or happening to other folks as well)
Well I found a solution and a workaround with some help from Reddit.
1) Solution:
Use DisplayPort instead of HDMI to connect the monitor - then KDE Plasma (and also Windows) correctly recognize when the monitor is turned off and disable it.
2) Workaround:
Use kscreen-doctor to manually disable / enable the secondary monitor (and bind the command to a key)
# Disable the secondary monitor
kscreen-doctor output.HDMI-A-1.disable
#Enable the secondary monitor and fix the primary monitors positioning
kscreen-doctor output.HDMI-A-1.enable output.DP-3.position.0,1120