Bug 507702 - Error on enabling secondary screen: Gaps between displays are not supported. Make sure all displays are touching.
Summary: Error on enabling secondary screen: Gaps between displays are not supported. ...
Status: CONFIRMED
Alias: None
Product: systemsettings
Classification: Applications
Component: kcm_kscreen (other bugs)
Version First Reported In: 6.4.3
Platform: NixOS Linux
: NOR major
Target Milestone: ---
Assignee: kscreen-bugs-null@kde.org
URL:
Keywords: multiscreen, wayland-only
: 485921 506544 507703 (view as bug list)
Depends on:
Blocks:
 
Reported: 2025-07-31 16:50 UTC by alfonse00
Modified: 2025-10-21 16:06 UTC (History)
8 users (show)

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


Attachments
The configuration problem (23.76 KB, image/png)
2025-07-31 16:50 UTC, alfonse00
Details
Screenshot: KScreen with Plasma 6.4.5 (345.17 KB, image/png)
2025-09-18 12:11 UTC, postix
Details
Journalctl output, when plugging in the 2nd DP screen (8.81 KB, text/plain)
2025-09-18 18:24 UTC, postix
Details

Note You need to log in before you can comment on or make changes to this bug.
Description alfonse00 2025-07-31 16:50:53 UTC
Created attachment 183686 [details]
The configuration problem

SUMMARY

I have a problem trying to configure my secondary screen, it works fine in X11 but not in Wayland, it was working a few days ago until I disable it. Then, when I tried to enable it again I got a message saying "Gaps between displays are not supported. Make sure all displays are touching." The secondary screen is not visible in the configuration when I try to edit the arrangement so I have a screen that can't be used with KDE plasma wayland as a secondary screen, it can work as primary.

STEPS TO REPRODUCE
1.  Disable the secondary screen
2.  Enable it again

OBSERVED RESULT

An error will made it unable to work


EXPECTED RESULT

Having the secondary screen in the configuration of the arrangement and being able to use it.

SOFTWARE/OS VERSIONS
Operating System: NixOS 25.11
KDE Plasma Version: 6.4.3
KDE Frameworks Version: 6.16.0
Qt Version: 6.9.1
Kernel Version: 6.12.40 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 5800X 8-Core Processor
Memory: 32 GiB of RAM (31,3 GiB usable)
Graphics Processor: NVIDIA GeForce RTX 3090

ADDITIONAL INFORMATION

The secondary screen is a samsung S19F350 that has a resolution of 1366x768 and my primary screen is 1080p. I will repeat, the screens work in kde plasma X11 but the secondary has this config problem only in wayland.

Seeing the possible duplicates this could be related to https://bugs.kde.org/show_bug.cgi?id=506544 , but how it happened it is different, although a possible solution could probably handle both problems at once. I also will add that I didn't change anything related to the scale factor, so it is not related to these.
Comment 1 alfonse00 2025-07-31 16:54:32 UTC
To add, the kscreen-doctor info:

Output: 1 HDMI-A-1 6f00cf97-6ac0-4275-a34e-310635116acc
        disabled
        connected
        priority 0
        HDMI
        replication source:0
        Modes:  1:1366x768@60*!  2:1920x1080@60  3:1280x720@60  4:1280x720@60  5:1024x768@75  6:1024x768@70  7:1024x768@60  8:800x600@75  9:800x600@72  10:800x600@60  11:800x600@56  12:720x480@60  13:720x480@60  14:640x480@75  15:640x480@73  16:640x480@60 
        Geometry: 2147483647,2147483647 1366x768
        Scale: 1
        Rotation: 1
        Overscan: 0
        Vrr: incapable
        RgbRange: unknown
        HDR: incapable
        Wide Color Gamut: incapable
        ICC profile: none
        Color profile source: sRGB
        Color power preference: prefer efficiency and performance
        Brightness control: supported, set to 37% and dimming to 100%
        Color resolution: unknown
        Allow EDR: unsupported
Output: 2 DP-1 9a697db3-d7d3-4da9-9572-61c5a52aca6a
        enabled
        connected
        priority 1
        DisplayPort
        replication source:0
        Modes:  17:1920x1080@60!  18:3840x2160@60  19:3840x2160@30  20:3840x2160@25  21:3840x2160@24  22:1920x1080@240*  23:1920x1080@200  24:1920x1080@144  25:1920x1080@60  26:1920x1080@50  27:1680x1050@60  28:1280x1024@75  29:1280x1024@60  30:1440x900@60  31:1280x960@60  32:1152x864@75  33:1280x720@60  34:1280x720@60  35:1280x720@50  36:1024x768@75  37:1024x768@70  38:1024x768@60  39:800x600@75  40:800x600@72  41:800x600@60  42:800x600@56  43:720x576@50  44:720x480@60  45:640x480@75  46:640x480@73  47:640x480@60  48:640x480@60 
        Geometry: 0,0 1920x1080
        Scale: 1
        Rotation: 1
        Overscan: 0
        Vrr: Never
        RgbRange: unknown
        HDR: enabled
                SDR brightness: 370 nits
                SDR gamut wideness: 95%
                Peak brightness: 1140 nits, overridden with: 1140 nits
                Max average brightness: 400 nits
                Min brightness: 0.0515 nits
        Wide Color Gamut: enabled
        ICC profile: none
        Color profile source: sRGB
        Color power preference: prefer accuracy
        Brightness control: supported, set to 100% and dimming to 100%
        Color resolution: unknown
        Allow EDR: unsupported
Comment 2 TraceyC 2025-08-04 22:25:08 UTC
*** Bug 506544 has been marked as a duplicate of this bug. ***
Comment 3 TraceyC 2025-08-04 22:27:31 UTC
Thanks for the bug report. I'm seeing a few other similar issues reported. In bug 507703, if the displays are rearranged, they disappear from the UI. Does this happen for you as well?
Comment 4 Bug Janitor Service 2025-08-19 03:46:29 UTC
🐛🧹 ⚠️ This bug has been in NEEDSINFO status with no change for at least 15 days. Please provide the requested information, then set the bug status to REPORTED. If there is no change for at least 30 days, it will be automatically closed as RESOLVED WORKSFORME.

For more information about our bug triaging procedures, please read https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging.

Thank you for helping us make KDE software even better for everyone!
Comment 5 alfonse00 2025-08-19 04:00:40 UTC
(In reply to TraceyC from comment #3)
> Thanks for the bug report. I'm seeing a few other similar issues reported.
> In bug 507703, if the displays are rearranged, they disappear from the UI.
> Does this happen for you as well?

It did disapeared, as shown in the attachment, but I never moved it, the problems might have a common cause.

I did eventually managed to do a workaround for the problem, I hope it helps, I used the CLI tools to enable the second monitor and move it where it should be, in the process I input the wrong number once and the secondary screen was turned on and available even with gaps, but that is not important for this.
The two commands that enabled and correctly positioned the secondary screen were
```
kscreen-doctor output.HDMI-A-1.enable
kscreen-doctor output.HDMI-A-1.position.1920,0
```

The position should be corrected depending on the primary screen resolution and the  `HDMI-A-1` should be changed to whatever the port for the secondary screen is. I hope the workaround helps to find a permanent solution.
Comment 6 TraceyC 2025-08-19 16:25:39 UTC
*** Bug 507703 has been marked as a duplicate of this bug. ***
Comment 7 TraceyC 2025-08-19 16:28:34 UTC
Thanks for the additional information, that helps. It does look like both reports are for the same problem.
The duplicate report has a screen recording of the issue that's helpful.

I haven't seen this on git-master or Plasma 6.4.4, and I have seen it previously.

I'll let the developers take it from here.
Comment 8 Nate Graham 2025-08-26 21:15:04 UTC
*** Bug 485921 has been marked as a duplicate of this bug. ***
Comment 9 postix 2025-09-18 12:11:53 UTC
Created attachment 185043 [details]
Screenshot: KScreen with Plasma 6.4.5

Got the same issue: I attached a second DisplayPort screen. 

The first error:
On enabling, I get the error "Gaps between displays are not supported. Make sure all displays are touching." 
I think Plasma should handle and fix this correctly itself out of the box.
Also, the monitor doesn't turn on, I can't hit "apply" due to the error.

The second error:
There are no screens drawn in my KScreen, that I could drag.

SYSTEM
Operating System: openSUSE Tumbleweed 20250914
KDE Plasma Version: 6.4.5
KDE Frameworks Version: 6.17.0
Qt Version: 6.9.2
Kernel Version: 6.16.7-1-default (64-bit)
Graphics Platform: Wayland
Graphics Processor: AMD Radeon RX 580 Series
Comment 10 postix 2025-09-18 14:50:44 UTC
If there's more information you need or something you want me to test, I will keep the device for a week from now.
Comment 11 postix 2025-09-18 15:30:34 UTC
Two more pointers:

- I've tested it with a newly created user account on Wayland: Works fine!
- I've renamed kwinrc and kwinoutputconfig.json and purged Plasma's and kwin's cache and logged out and back in: negative, the bug still appears with the old user account.
Comment 12 alfonse00 2025-09-18 15:42:27 UTC
(In reply to postix from comment #10)
> If there's more information you need or something you want me to test, I
> will keep the device for a week from now.

You could test with the command line options to configure the screen, that could help confirm that this workaround works in more systems and screens, in the comments there are the commands I used and the modifications you would need for your system, it is one command to enable the screen and the other to move it, pay attention to the screen identifier, in your case it should be something like DP-X and the position would depend on the primary screen resolution, 1920,0 for 1080p and 3840,0 for 4k, so the commands would most likely be

```
kscreen-doctor output.DP-2.enable
kscreen-doctor output.DP-2.position.1920,0
```

to add, I also tried the purge of the old configs and it also didn't solve the issue, that is when I went into using the CLI to change the config.
Comment 13 postix 2025-09-18 18:04:36 UTC
I've logged in via ssh and tried the commands, but I get a SIGABRT :-(

```
kscreen-doctor output.DP-2.position.1920,0
qt.qpa.xcb: could not connect to display 
qt.qpa.plugin: From 6.5.0, xcb-cursor0 or libxcb-cursor0 is needed to load the Qt xcb platform plugin.
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vkkhrdisplay, vnc, xcb, wayland-egl, wayland.

Aborted (Core dumped) kscreen-doctor output.DP-2.enable
```

```
Thread 1 (Thread 0x7fb047e0c980 (LWP 11792)):
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at pthread_kill.c:44
#1  0x00007fb048e9de53 in __pthread_kill_internal (threadid=<optimized out>, signo=6) at pthread_kill.c:89
#2  0x00007fb048e427b6 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fb048e2934b in __GI_abort () at abort.c:73
#4  0x00007fb0496f4220 in qAbort () at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/corelib/global/qassert.cpp:46
#5  qt_message_fatal<QString&> (context=..., message=...) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/corelib/global/qlogging.cpp:2149
#6  qt_message(QtMsgType, const QMessageLogContext &, const char *, typedef __va_list_tag __va_list_tag *) (msgType=msgType@entry=QtFatalMsg, context=..., msg=msg@entry=0x7fb04a5e8bfa "%s", ap=ap@entry=0x7ffcc5bf9718) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/corelib/global/qlogging.cpp:381
#7  0x00007fb0496f50ff in QMessageLogger::fatal (this=this@entry=0x7ffcc5bf9c40, msg=msg@entry=0x7fb04a5e8bfa "%s") at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/corelib/global/qlogging.cpp:883
#8  0x00007fb049f79846 in init_platform (pluginNamesWithArguments=..., platformPluginPath=..., platformThemeName=..., argc=@0x7ffcc5bfa07c: 2, argv=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.cpp:1345
#9  QGuiApplicationPrivate::createPlatformIntegration (this=0x56496163e140) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.cpp:1591
#10 0x00007fb04a025108 in QGuiApplicationPrivate::createEventDispatcher (this=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.cpp:1610
#11 0x00007fb0497cf485 in QCoreApplicationPrivate::init (this=this@entry=0x56496163e140) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/corelib/kernel/qcoreapplication.cpp:866
#12 0x00007fb04a0251ae in QGuiApplicationPrivate::init (this=0x56496163e140) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.cpp:1638
#13 0x00007fb04a026416 in QGuiApplication::QGuiApplication (this=<optimized out>, argc=<optimized out>, argv=<optimized out>, this=<optimized out>, argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/qtbase-everywhere-src-6.9.2/src/gui/kernel/qguiapplication.h:172
#14 0x000056492e85f744 in main (argc=<optimized out>, argv=<optimized out>) at /usr/src/debug/libkscreen-6.4.5/src/doctor/main.cpp:86
```
Comment 14 postix 2025-09-18 18:09:14 UTC
Some more observations:

1) in journalctl I see
```
kwin_wayland[2368]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[2368]: kf.config.core: "\"restore1\" - conversion of \"-49.5,49.5,50.5,50.5\" to QRect failed"
kwin_wayland[2368]: kf.config.core: "\"fsrestore1\" - conversion of \"0,0,0,0\" to QRect failed"
kwin_wayland[2368]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
kwin_wayland[2368]: kwin_scene_opengl: Could not delete render time query because no context is current
kwin_wayland[2368]: kwin_scene_opengl: Could not delete render time query because no context is current
kwin_wayland[8356]: No backend specified, automatically choosing drm
kwin_wayland[8356]: kf.config.core: "\"restore1\" - conversion of \"-49.5,49.5,50.5,50.5\" to QRect failed"
kwin_wayland[8356]: kf.config.core: "\"fsrestore1\" - conversion of \"0,0,0,0\" to QRect failed"
kwin_wayland[8356]: kf.windowsystem: static bool KX11Extras::mapViewport() may only be used on X11
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[8356]: kwin_core: Closing a layer shell window due to invalid geometry
kwin_wayland[8356]: kwin_core: Closing a layer shell window due to invalid geometry
kwin_wayland[8356]: kwin_core: Closing a layer shell window due to invalid geometry
kwin_wayland[8356]: kwin_core: Closing a layer shell window due to invalid geometry
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
```

2) I've renamed .config, .local/share/kscreen, purged .cache/ and rebooted:
On logging back in, kwinoutputconfig.json contains data about formerly attached screens, e.g. some HDMI connector: it seems somehow it still manages somegow to load old faulty configs.
Comment 15 postix 2025-09-18 18:24:53 UTC
Created attachment 185058 [details]
Journalctl output, when plugging in the 2nd DP screen

```
kwin_wayland[8356]: kwin_xwl: Could not find a matching X RandR CRTC/output to set as primary for KWin::DrmOutput(0x55d1466aeba0, name="DP-2", geometry=QRect(0,0 1920x1080), scale=2)
org_kde_powerdevil ...
org_kde_powerdevil[8736]: [ 13334] Adding connected display with bus 7
...
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[8356]: kwin_core: Closing a layer shell window due to invalid geometry
...
plasmashell[8689]: kde.plasmashell: requesting unexisting screen available rect -1
kwin_wayland[8356]: kwin_core: Closing a layer shell window due to invalid geometry (4x)
org_kde_powerdevil ...
org_kde_powerdevil[8736]: [ 13334] Adding connected display with bus 6
...
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
kwin_wayland[8356]: kwin_output_config: Output DP-1 is trying to mirror itself, that shouldn't happen!
```
Comment 16 postix 2025-09-19 09:35:32 UTC
When I've checked the auto generated `~/.config/kwinoutputconfig.json`, I've noticed that the topleft coordinates of one setup is oddly large:

```
            {
                "lidClosed": false,
                "outputs": [
                    {
                        "enabled": true,
                        "outputIndex": 0,
                        "position": {
                            "x": 2147483647,
                            "y": 2147483647
                        },
                        "priority": 0,
                        "replicationSource": "2288310c-7536-42ca-b4db-9f8910eb1829"
                    },
                    {
                        "enabled": false,
                        "outputIndex": 2,
                        "position": {
                            "x": 2147483647,
                            "y": 2147483647
                        },
                        "priority": -1,
                        "replicationSource": "2288310c-7536-42ca-b4db-9f8910eb1829"
                    }
                ]
            },
```

This would explain to me at least, why the screen to drag isn't drawn in the kcm.
Comment 17 postix 2025-09-19 09:38:10 UTC
fwiw, 2147483647 is the largest number, which fits into an int32.
Comment 18 alfonse00 2025-09-19 13:27:48 UTC
(In reply to postix from comment #16)

Are you on laptop? Following, did you checked that the identifier was correct before running the commands? I should have also asked for the output of  `kscreen-doctor -o`. With the current information I would think this is a similar error, but with a very different root cause.
Comment 19 postix 2025-09-19 14:54:00 UTC
(In reply to alfonse00 from comment #18)
> Are you on laptop?

I ran the kscreen-doctor commands over ssh, obviously this isn't supposed to work. So, I executed now
```
sleep 10 && kscreen-doctor output.DP-1.enable && kscreen-doctor output.DP-1.position.0,0 && kscreen-doctor output.DP-2.position.3840,0
```
before I plugged in 2nd screen. This time the 2nd screen kept being black but I could at least continue working with the primary one.
In KScreen, the screen was disabled though. When I tried to enable it, said
> Couldn’t apply display configuration: The driver rejected the output configuration

I could now also check with kscreen-doctor -o that the connector names are indeed DP-1 and DP-2
Comment 20 postix 2025-09-19 14:54:40 UTC
```
kscreen-doctor -o
Output: 1 DP-2 021e8b61-25ed-40a2-8225-ef9a0a884aeb
        enabled
        connected
        priority 1
        DisplayPort
        replication source:2
        Modes:  1:3840x2160@60*!  2:3840x2160@30  3:3840x2160@25  4:3840x2160@24  5:1920x1200@60  6:1920x1080@60  7:1600x1200@60  8:1680x1050@60  9:1280x1024@60  10:1440x900@60  11:1280x960@60  12:1280x800@60  13:1280x720@60  14:1024x768@60  15:800x600@60  16:640x480@60  17:720x400@70  18:2560x1600@60  19:3200x1800@60  20:2880x1620@60  21:2560x1440@60  22:1600x900@60  23:1368x768@60 
        Geometry: 0,0 1920x1080
        Scale: 2
        Rotation: 1
        Overscan: 0
        Vrr: incapable
        RgbRange: Automatic
        HDR: incapable
        Wide Color Gamut: incapable
        ICC profile: none
        Color profile source: sRGB
        Color power preference: prefer accuracy
        Brightness control: supported, set to 100% and dimming to 100%
        Color resolution: automatic (16), range: [8; 16] bits per color
        Allow EDR: unsupported
Output: 2 DP-1 2288310c-7536-42ca-b4db-9f8910eb1829
        disabled
        connected
        priority 0
        DisplayPort
        replication source:2
        Modes:  24:3840x2160@60*!  25:3840x2160@60  26:3840x2160@60  27:3840x2160@50  28:3840x2160@30  29:3840x2160@30  30:3840x2160@25  31:3840x2160@24  32:3840x2160@24  33:2560x1440@160  34:2560x1440@120  35:2560x1440@60  36:1920x1200@60  37:1920x1080@120  38:1920x1080@120  39:1920x1080@100  40:1920x1080@60  41:1920x1080@60  42:1920x1080@60  43:1920x1080@50  44:1920x1080@30  45:1920x1080@30  46:1920x1080@25  47:1920x1080@24  48:1920x1080@24  49:1600x1200@60  50:1680x1050@60  51:1280x1024@60  52:1440x900@60  53:1280x960@60  54:1280x800@60  55:1280x720@60  56:1280x720@60  57:1280x720@60  58:1280x720@50  59:1024x768@75  60:1024x768@60  61:800x600@75  62:800x600@60  63:720x576@50  64:720x576@50  65:720x480@60  66:720x480@60  67:720x480@60  68:720x480@60  69:640x480@75  70:640x480@60  71:640x480@60  72:640x480@60  73:2560x1600@60  74:3200x1800@60  75:2880x1620@60  76:1600x900@60  77:1368x768@60 
        Geometry: 0,0 1920x1080
        Scale: 2
        Rotation: 1
        Overscan: 0
        Vrr: Automatic
        RgbRange: Automatic
        HDR: disabled
        Wide Color Gamut: disabled
        ICC profile: none
        Color profile source: sRGB
        Color power preference: prefer efficiency and performance
        Brightness control: supported, set to 100% and dimming to 100%
        DDC/CI: allowed
        Color resolution: automatic (10), range: [8; 16] bits per color
        Allow EDR: unsupported
```
Comment 21 postix 2025-09-19 17:27:51 UTC
> - I've tested it with a newly created user account on Wayland: Works fine!
I am not sure if the new user logged in into a X11 session actually. The X11 session works fine, Wayland does not.
Comment 22 Matej Starc 2025-10-19 07:49:01 UTC
I've stumbled upon this issue myself after tinkering with display settings (it worked perfectly before). I would assume something is not checking for that -1 int return from a function.