After switching to discrete graphics card, windows only maximize to one of two monitors

I have a desktop machine with two monitors, running Debian 11 with KDE (Plasma version 5.20.5).

I recently installed a discrete graphics card and switched from integrated graphics to the discrete graphics card (so that the monitor cables are now connected to ports on the discrete graphics card).

Since I’ve done this, my Plasma session has been exhibiting strange window mangement behaviours, most notably that applications will only maximize to one of the two monitors (the one on the right side).

More specifically:

  • All windows initially open on the right-side monitor. (Including, interestingly, the application launcher window, even though the task bar and application launcher icon are on the left-side monitor.)
  • If I drag a window to the left-side monitor, and click Maximize, it maximizes to the right-side monitor.
  • If I drag a window towards the top edge of the left-side monitor (a gesture which should have the effect of maximizing the window), it shows the maximize animation on the right-side monitor and maximizes the window on the right-side monitor.

In addition, the “Window to Next Screen” and “Window to Previous Screen” shortcuts (another way to move maximized windows from one monitor to another) have stopped working, even though they still show up in the KWin section of Shortcuts in System Settings.

Any suggestions for what might have gone wrong or how to diagnose the issue further?

In respect to further diagnosis, perhaps try is setting up a new user. If the new user’s login works properly, then it must be some setting stored under the existing user.

Thanks for the suggestion! The issue persists in a new user login as well.

I’ve noticed one other symptom as well: when bringing the cursor to the left edge of the left monitor, the cursor stops as expected. But when bringing the cursor to the right edge of the right monitor, the cursor can go “beyond” the right edge, as if KDE thinks there is a third monitor there.

Any further ideas are welcome!

Perhaps provide some more info and see if anyone here pipes up. Also consider asking on a debian forum or one specific to your graphics card.

You could start with posting the info from System Settings->About This System. If you’ve installed inxi, much more detailed info can be obtained from:

inxi -GSaz --za

My own experience is with nvidia proprietary only, and mostly X11, for which I disable the background service KScreen2 and configure multiple screens using xrandr, something like:

xrandr --output DP-4 --auto --output DP-0 --auto  --right-of DP-4

The xrandr command by itself will provide some info on the current configuration, such as which connectors are attached to monitors and how they are arranged.

The arch wiki is a good place to start for general help on many things, including multi-head:

https://wiki.archlinux.org/title/Multihead

Here are the contents of System Settings → System Information:

Operating System: Debian GNU/Linux 11
KDE Plasma Version: 5.20.5
KDE Frameworks Version: 5.78.0
Qt Version: 5.15.2
Kernel Version: 5.10.0-29-amd64
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4790K CPU @ 4.00GHz
Memory: 31.2 GiB of RAM
Graphics Processor: AMD Radeon ™ RX 460 Graphics

inxi does not seem to like --za, but here is the output of just inxi -GSaz:

System:    Kernel: 5.10.0-29-amd64 x86_64 bits: 64 compiler: gcc v: 10.2.1
           parameters: BOOT_IMAGE=/vmlinuz-5.10.0-29-amd64 root=/dev/mapper/liberty--vg-root ro quiet
           Desktop: KDE Plasma 5.20.5 tk: Qt 5.15.2 wm: kwin_x11 dm: SDDM Distro: Debian GNU/Linux 11 (bullseye)
Graphics:  Device-1: Intel Xeon E3-1200 v3/4th Gen Core Processor Integrated Graphics vendor: Gigabyte driver: i915 v: kernel
           bus ID: 00:02.0 chip ID: 8086:0412 class ID: 0300
           Device-2: AMD Baffin [Radeon RX 460/560D / Pro 450/455/460/555/555X/560/560X] vendor: ASUSTeK driver: amdgpu
           v: kernel bus ID: 01:00.0 chip ID: 1002:67ef class ID: 0300
           Display: x11 server: X.Org 1.20.11 compositor: kwin_x11 driver: loaded: amdgpu,intel display ID: :0 screens: 2
           default screen: 0
           Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x285mm (40.0x11.2") s-diag: 1055mm (41.5")
           Monitor-1: HDMI-A-2 res: 1920x1080 hz: 60 dpi: 96 size: 510x290mm (20.1x11.4") diag: 587mm (23.1")
           Monitor-2: DVI-D-0 res: 1920x1080 hz: 60 dpi: 96 size: 510x290mm (20.1x11.4") diag: 587mm (23.1")
           Screen-2: 1 s-res: 1024x768 s-dpi: 96 s-size: 271x203mm (10.7x8.0") s-diag: 339mm (13.3")
           OpenGL: renderer: AMD Radeon RX 460 Graphics (POLARIS11 DRM 3.40.0 5.10.0-29-amd64 LLVM 11.0.1) v: 4.6 Mesa 20.3.5
           direct render: Yes

And lastly, xrandr:

$ xrandr
Screen 0: minimum 320 x 200, current 3840 x 1080, maximum 16384 x 16384
DisplayPort-0 disconnected (normal left inverted right x axis y axis)
HDMI-A-2 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 510mm x 290mm
   1920x1080     60.00*+  50.00    59.94
   1680x1050     59.88
   1280x1024     60.02
   1440x900      60.00
   1280x960      60.00
   1280x800      60.00
   1280x720      60.00    50.00    59.94
   1024x768      60.00
   800x600       60.32
   720x576       50.00
   720x480       60.00    59.94
   640x480       60.00    59.94
DVI-D-0 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 510mm x 290mm
   1920x1080     60.00*+
   1680x1050     59.88
   1280x1024     75.02    60.02
   1440x900      60.00
   1280x960      60.00
   1280x800      60.00
   1152x864      75.00
   1280x720      60.00
   1024x768      75.03    60.00
   832x624       74.55
   800x600       75.00    60.32    56.25
   640x480       75.00    59.94
   720x400       70.08

I don’t have much experience interpreting this output, but one thing that’s making me curious is the following part of the inxi output:

Screen-1: 0 s-res: 3840x1080 s-dpi: 96 s-size: 1016x285mm (40.0x11.2") s-diag: 1055mm (41.5")
Monitor-1: HDMI-A-2 res: 1920x1080 hz: 60 dpi: 96 size: 510x290mm (20.1x11.4") diag: 587mm (23.1")
Monitor-2: DVI-D-0 res: 1920x1080 hz: 60 dpi: 96 size: 510x290mm (20.1x11.4") diag: 587mm (23.1")
Screen-2: 1 s-res: 1024x768 s-dpi: 96 s-size: 271x203mm (10.7x8.0") s-diag: 339mm (13.3")

What is the difference between “screens” and “monitors” here? Having two monitors with resolution 1920x1080 each, adding up to a total of 3840x1080 looks right, but what’s with there being a second “screen” with resolution 1024x768?

X11 refers to Screens as separate X-Screens. So you have two Devices/Monitors on two independent Screens. I suspect this might be the cause of the issues you are encounting.

Normally I would combine monitors into a single virtual-screen. I normally do this via nvidia-settings, I’m not familiar with how to set that up using AMD/Radeon. The arch wiki does describe how to do this using xrandr or by changing the xorg configuration.

I’m not aware of a Plasma application that might help with this. You might like to wait and see if anyone familiar with configuring AMD replies.

An additional finding: the problem does not occur in a “Plasma (Wayland)” session, leading me to believe that the issue is with my X configuration.

I had to run Xorg --configure after installing the discrete GPU to get a graphical session to start at all; maybe it got some things wrong.

Just to close the loop here: after using a Wayland session for a while and eventually getting tired of a few things which are still buggy with Wayland, I went back to my X11 session to try and solve the issue, and I’m happy to report that simply removing /etc/X11/xorg.conf fixed all the problems.

Thank you all for your suggestions!

Out of curiosity, what were your main blockers for switching to Wayland?

  1. Copy-paste is unreliable. Sometimes I select some text and press Ctrl+C, and then switch to another application and press Ctrl+V, and nothing is pasted. I have to go back and copy it again, and the second time is usually works. This only happens about 1 in 10 times I copy/paste, but it’s enough to be quite annoying.
  2. Dialog windows sometimes don’t show up. For example, in Firefox, sometimes I press Alt+F to show the file menu, or the Pocket button to show the dialog for saving an article to Pocket, and the window that’s supposed to appear does not. Trying again usually makes it work. Occasionally, entire application windows (e.g. Visual Studio Code) fail to show up; the process is running, and the window has an entry in the Task Switcher, but the window isn’t rendered; once again resolved by quitting the application and trying a second time.
  3. Some games support X11 but not Wayland.

Note, I’m running Debian 11 (which is now oldstable) which comes with Plasma 5.20. I’m optimistic that issues (1) and (2) are improved in newer versions of kwin_wayland, just need to find the time to upgrade.

1 Like

Forgot to add: taking screenshots does not work in Wayland. This one unfortunately doesn’t seem to be fixed in Debian 12 either.