KDE on dual monitors on Debian 12 using X11

I have a (pretty cheap) laptop happily running Debian 12 with KDE Plasma 5.27.5. Its display is set to 1920x1080 and it works well. I originally opened this query on the Debian forum:

https://forums.debian.net/viewtopic.php?t=155471

It was recommended that I ask on a dedicated KDE Forum which is why I’m here.

Recently I acquired a (also pretty cheap) flatscreen TV with an HDMI port. I bought the correct Mini HDMI C to HDMI A cable, plugged in the TV and it popped to life with no effort. Debian detected it and KDE started to display. I can move the cursor between the screens and drag-and-drop windows between the two. So far so good.

Now, from looking around the Net (and on this site), I know that KDE Plasma 5 doesn’t play well with multiple monitors. I’m left with some issues that I can’t get my head around, so I thought I’d ask here.

  1. The laptop’s built-in screen is set to 1920x1080 and it’s the Primary display. The TV is capable of 1920x1080 but when I set this resolution, it’s as if the setting is too big to fit the physical display size of the TV screen. This means the KDE panels are “stretched” outside of the screen. They are too long to fit in the horizontal axis (so icons like the Application Launcher are not visible) and are half-hidden off the bottom of the screen.

  2. If I set the TV’s resolution to 1280x1024, then KDE starts to display correctly (if somewhat enlarged). All well and good. The Primary display has seven virtual workspaces. If I then add an Empty Panel to the TV, with no other widgets added, it seems the TV workspace switches when I change workspaces on the Primary display. This also happens when there are no panels (Application Menu Bar, Default or Empty) configured on the TV monitor.

I’m not sure what to look for other than the commands in the previous thread.

I initially used X11, experimented with Wayland (which seemed somewhat more temperamental), then moved back to X11. With xrandr and arandr, I created an x11.sh script:

9 colin@kuu> cat x11.sh
#!/bin/sh
xrandr --verbose --output eDP-1 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output HDMI-1 --mode 1920x1080i --pos 0x0 --rotate normal --output DP-1 --off --output HDMI-2 --off
10 colin@kuu>

I added the --verbose option manually. and the output is:

10 colin@kuu> pwd
/home/colin/.screenlayout
11 colin@kuu> ./x11.sh
crtc 0: 1920x1080 60.00 +1920+0 “eDP-1”
crtc 1: 1920x1080i 60.00 +0+0 “HDMI-1”
12 colin@kuu>

The problems described above still persist. In summary:

  1. The resolution of the TV monitor (HDMI-1), set to 1920x1080i, seems to ‘stretch’ the panel beyond the edges of the screen. In practice this means the Application Menu and Peek at Desktop icons can’t be seen. They are definitely present because I can push the mouse to the edge of the screen and see the tooltip pop-ups. Further, the lower half of the panel is off the bottom of the screen and can’t be seen.
  2. I use seven virtual desktops. When I switch between them on the Primary display (the laptop’s built in screen), the TV monitor switches to the same virtual desktop.

Should I be using X11 or Wayland with dual monitors? In my experience, Wayland has other problems which are even worse than the screen resolution. (For instance, if I have a file open in Kate on one virtual desktop, switch to another virtual desktop and open another file in Kate, the display switches back to the original virtual desktop and opens the file in the first instance of Kate.)

Please let me know if there’s any more information I can provide.

Regards,
Colin

In general, when using a TV in place of a monitor, there be dragons. :slight_smile: TVs like to do all sorts of weird things that make them not work as well as a real monitor, and you just ran into one of them: overscan.

You should set the TV to its native 1920x1080 resolution and then change the overscan value somewhere value to make the TV not cut off content like this. Some TVs have this option built into their settings or menu structure somewhere. There is also an option for this in the Display and Monitor page in System Settings. I think it’s only visible when in a Plasma Wayland session though. So if you don’t see it there, you’ll need to adjust it on the TV itself.

As for Virtual Desktops, Plasma doesn’t have per-screen virtual desktops like macOS and GNOME have.

1 Like

I can confirm this works on Plasma Wayland without problems, already solved the problem through this feature

1 Like

I’ve tried a couple of things but they seem to make no difference.

I logged out of X11 and logged back in under Wayland. xrandr output is:

4 colin@kuu> xrandr
Screen 0: minimum 16 x 16, current 3840 x 1080, maximum 32767 x 32767
XWAYLAND0 connected primary 1920x1080+1920+0 (normal left inverted right x axis y axis) 340mm x 190mm
1920x1080 59.96*+
1440x1080 59.99
1400x1050 59.98
1280x1024 59.89
1280x960 59.94
1152x864 59.96
1024x768 59.92
800x600 59.86
640x480 59.38
320x240 59.52
1680x1050 59.95
1440x900 59.89
1280x800 59.81
720x480 59.71
640x400 59.95
320x200 58.96
1600x900 59.95
1368x768 59.88
1280x720 59.86
1024x576 59.90
864x486 59.92
720x400 59.55
640x350 59.77
XWAYLAND1 connected 1920x1080+0+0 (normal left inverted right x axis y axis) 140mm x 90mm
1920x1080 23.91*+
1440x1080 23.89
1400x1050 23.87
1280x1024 23.87
1280x960 23.85
1152x864 23.90
1024x768 23.98
800x600 23.88
640x480 23.60
320x240 22.50
1680x1050 23.90
1440x900 23.91
1280x800 23.80
720x480 23.63
640x400 23.51
320x200 20.64
1600x900 23.88
1368x768 23.77
1280x720 23.87
1024x576 23.96
864x486 23.46
720x400 23.48
640x350 23.05
5 colin@kuu>

Then I ran arandr to generate an xrandr script:

14 colin@kuu> cat wayland_hdmi.sh.orig
#!/bin/sh
xrandr --output XWAYLAND0 --primary --mode 1920x1080 --pos 1920x0 --rotate normal --output XWAYLAND1 --mode 1920x1080 --pos 0x0 --rotate normal
15 colin@kuu>

XWAYLAND0 is the laptop’s built in monitor; XWAYLAND1 is the TV connected via HDMI.

I then edited this original file not to touch XWAYLAND0 and set overscan parameters on XWAYLAND1:

#!/bin/sh
xrandr --output XWAYLAND1 --set underscan on --set “underscan vborder” 76 --set “underscan hborder” 134 --mode 1920x1080 --pos 0x0 --rotate normal
16 colin@kuu>

The numbers 134 (horizontal) and 76 (vertical) came from the original 1920x1080 resolution, multiplied by 0.93, as suggested in the Wikipedia “Overscan” article.

When I ran this, I got the following output:

16 colin@kuu> ./wayland_hdmi.sh
X Error of failed request: BadName (named color or font does not exist)
Major opcode of failed request: 139 (RANDR)
Minor opcode of failed request: 11 (RRQueryOutputProperty)
Serial number of failed request: 29
Current serial number in output stream: 29
17 colin@kuu>

I can’t explain this error. Why would a missing font or color have this effect?

Afaik xrandr doesn’t work with wayland. Use the KDE gui or kscreen-doctor. Will look at this tomorrow more closely!

1 Like

Thanks for the info. Where can I download kscreen-doctor? It doesn’t seem to be available on Debian’s normal repos.

It is probably already installed by some KDE packages. Try kscreen-doctor -h

Coming from a RHEL/CentOS background, I didn’t know much about Debian, so wasn’t aware of kscreen-doctor. It is installed by default, so I tried:

2 colin@kuu> kscreen-doctor -o
Output: 1 eDP-1 enabled connected priority 1 Panel Modes: 0:1920x1080@60*! 1:1920x1080@48 2:1280x1024@60 3:1024x768@60 4:1280x800@60 5:1600x900@60 6:1368x768@60 7:1280x720@60 Geometry: 1920,0 1920x1080 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRange: Automatic
Output: 2 HDMI-A-1 enabled connected priority 2 HDMI Modes: 0:1440x900@60! 1:1920x1080@60 2:1920x1080@60 3:1920x1080@50 4:1920x1080@24* 5:1920x1080@24 6:1280x1024@75 7:1280x720@60 8:1280x720@60 9:1280x720@50 10:1024x768@75 11:1024x768@70 12:1024x768@60 13:800x600@75 14:800x600@72 15:800x600@60 16:800x600@56 17:720x576@50 18:720x576@50 19:720x480@60 20:720x480@60 21:720x480@60 22:720x480@60 23:640x480@75 24:640x480@73 25:640x480@60 26:640x480@60 27:640x480@60 Geometry: 0,0 1920x1080 Scale: 1 Rotation: 1 Overscan: 0 Vrr: incapable RgbRa

HDMI-A-1 is the TV monitor. You can see from the HDMI-A-1 output there are 5 1920x1080 modes. I’ve tried all of these with no effect. Given the earlier post about Overscan, how do I set this with kscreen-doctor?

Thanks,
Colin

I am unsure why want to do this in the terminal and not in the GUI. The GUI would be much easier.

Anyway if you want to use the terminal using kscreen-doctor:

To set your screen to 1920x1080 with 60 Hz refresh rate you would do it like so:
kscreen-doctor output.HDMI-A-1.mode.1920x1080@60

To set the Overscan to 5% you use:
kscreen-doctor output.HDMI-A-1.overscan.5

Hope that helps.

I tried the following with no appreciable effect:

1 colin@kuu> kscreen-doctor output.HDMI-A-1.mode.1920x1080@60
kscreen.doctor: Taddaaa! Found mode “1” “1920x1080@60”
kscreen.doctor: Output 2 set mode “1920x1080@60”
kscreen.doctor: setop exec returned KScreen::Config(
KScreen::Output(1, “eDP-1”, connected enabled priority 1, pos: QPoint(1920,0), res: QSize(1920, 1080), modeId: “0”, scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false)
KScreen::Output(2, “HDMI-A-1”, connected enabled priority 2, pos: QPoint(0,0), res: QSize(1920, 1080), modeId: “1”, scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) )
2 colin@kuu> Initializing “/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/kcms/systemsettings/kcm_fonts.so”

2 colin@kuu>
2 colin@kuu> kscreen-doctor output.HDMI-A-1.overscan.5
kscreen.doctor: setop exec returned KScreen::Config(
KScreen::Output(1, “eDP-1”, connected enabled priority 1, pos: QPoint(1920,0), res: QSize(1920, 1080), modeId: “0”, scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false)
KScreen::Output(2, “HDMI-A-1”, connected enabled priority 2, pos: QPoint(0,0), res: QSize(1920, 1080), modeId: “1”, scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) )
3 colin@kuu> Initializing “/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/kcms/systemsettings/kcm_fonts.so”

I’m comfortable using the command line but will happily use the GUI but it seems to have no effect either.

Colin

You are still using Wayland right?
Try a higher % of overscan.

Does it not work at all or is it just not correct?

I am still using Wayland. Even with Overscan set to 100, there is still no effect:

7 colin@kuu> kscreen-doctor output.HDMI-A-1.overscan.100
kscreen.doctor: setop exec returned KScreen::Config(
KScreen::Output(1, “eDP-1”, connected enabled priority 1, pos: QPoint(1920,0), res: QSize(1920, 1080), modeId: “0”, scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false)
KScreen::Output(2, “HDMI-A-1”, connected enabled priority 2, pos: QPoint(0,0), res: QSize(1920, 1080), modeId: “4”, scale: 1, clone: no, rotation: KScreen::Output::None, followPreferredMode: false) )
8 colin@kuu> Initializing “/usr/lib/x86_64-linux-gnu/qt5/plugins/plasma/kcms/systemsettings/kcm_fonts.so”

This has no effect on the TV monitor display. The Panel at the bottom of the screen still displays outside the screen area, meaning Peak At Desktop and Application Launcher are off screen and the Panel’s icons and workspaces are not fully visible (they are at about half height).

OverScan or UnderScan?

I managed to navigate my way through the TV monitor’s (temperamental) on-screen menus (I lost the remote, so had to use the hardware buttons). I found an HDMI submenu which had an option for Overscan which could be changed to Underscan. I selected Underscan and the display instantly changed to showing the full panel, workspaces, Application Launcher and Peek at Desktop.

So I’m very happy with this result.

I’d like to know if there’s an underscan option available through kscreen-doctor. There’s no manpage installed and -h or --help-all don’t show any config options. Something like:

kscreen-doctor output.HDMI-A-1.underscan.X

Where X is a given value.

I’m now wondering if I reboot the TV monitor, I’ll have to go through the same on-screen process.

Any suggestions would be gratefully received.

Colin

I have an old Samsung TV connected to an HDMI port on my GPU card. Most of the time it is off and disabled - I just use it occasionally to watch Netflix or a DVD. I also had the overscan problem, but was too lazy to figure out how to fix it, so I was glad to see this thread.

There is a “Screen Fit” option buried deep down in the TV’s menus that fixed this.

I think we can mark this as solved. How do I do this, please?

It’s quite clear (if accidental) that the problem was related to the hardware of the TV monitor and is not really a KDE issue.

Thanks for all the help and advice.

Colin

The Topic is already marked solved. See post #1 or #2

Thanks for making a proper effort in posting your issues in detail with terminal output. Makes trying to help a lot easier.

Hope everything works out for you. If not just come back :slight_smile:

1 Like