Prevent sleep from messing with my display layout

Occasionaly but frequently sleep messes with my display layout

I have a docking station with two displays connected. After my laptop going to inactivity and coming back the screens are messed up. Is there a simple trick to prevent this from happening? I have to disconnect the docking and reconnect and manually setup priority and move the windows to the location the where in.

$ inxi

CPU: 16-core (6-mt/10-st) Intel Core Ultra 7 155H (-MST AMCP-)
speed/min/max: 1723/400/1400:900:700 MHz Kernel: 7.1.10-200.fc44.x86_64 x86_64
Up: 2d 17h 47m Mem: 19.69/62.29 GiB (31.6%) Storage: 1.39 TiB (16.5% used)
Procs: 563 Shell: Bash inxi: 3.3.41
j@rhnmnb19572:~$ inxi -F
System:
Host: rhnmnb19572 Kernel: 7.1.10-200.fc44.x86_64 arch: x86_64 bits: 64
Desktop: KDE Plasma v: 6.7.4 Distro: Fedora Linux 44 (KDE Plasma Desktop
Edition)
Machine:
Type: Laptop System: LENOVO product: 21KS002EMZ v: ThinkPad P16s Gen 3
serial:
Mobo: LENOVO model: 21KS002EMZ v: SDK0T76530 WIN
serial: Firmware: UEFI vendor: LENOVO
v: R2DET42W (1.27 ) date: 04/24/2026
Battery:
ID-1: BAT0 charge: 66.7 Wh (99.9%) condition: 66.7/75 Wh (88.9%)
CPU:
Info: 16-core (6-mt/10-st) model: Intel Core Ultra 7 155H bits: 64
type: MST AMCP cache: L2: 18 MiB
Speed (MHz): avg: 1993 min/max: 400/1400:900:700 cores: 1: 1993 2: 1993
3: 1993 4: 1993 5: 1993 6: 1993 7: 1993 8: 1993 9: 1993 10: 1993 11: 1993
12: 1993 13: 1993 14: 1993 15: 1993 16: 1993 17: 1993 18: 1993 19: 1993
20: 1993 21: 1993 22: 1993
Graphics:
Device-1: Intel Meteor Lake-P [Intel Arc Graphics] driver: i915 v: kernel
Device-2: NVIDIA AD107GLM [RTX 500 Ada Generation Laptop GPU]
driver: nouveau v: kernel
Device-3: Syntek Integrated Camera driver: uvcvideo type: USB
Device-4: Logitech BRIO Ultra HD Webcam
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB
Display: wayland server: Xwayland v: 24.1.13 compositor: kwin_wayland
driver: gpu: i915 resolution: 1: 2560x1080~90Hz 2: 1920x1080~60Hz
3: 1920x1200~60Hz
API: EGL v: 1.5 drivers: iris,swrast,zink
platforms: gbm,wayland,x11,surfaceless,device
API: OpenGL v: 4.6 vendor: intel mesa v: 26.1.8 renderer: Mesa Intel Arc
Graphics (MTL)
API: Vulkan v: 1.4.341 drivers: intel,nvk,llvmpipe surfaces: N/A
Info: Tools: api: clinfo, eglinfo, glxinfo, vulkaninfo
de: kscreen-console,kscreen-doctor wl: wayland-info x11: xdriinfo,
xdpyinfo, xprop, xrandr
Audio:
Device-1: Intel Meteor Lake-P HD Audio driver: sof-audio-pci-intel-mtl
Device-2: Texas Instruments PCM2704 16-bit stereo audio DAC
driver: hid-generic,snd-usb-audio,usbhid type: USB
Device-3: XMOS m9XX USB Audio driver: snd-usb-audio type: USB
Device-4: Lenovo ThinkPad Thunderbolt 4 Dock USB Audio
driver: hid-generic,snd-usb-audio,usbhid type: USB
Device-5: Logitech BRIO Ultra HD Webcam
driver: hid-generic,snd-usb-audio,usbhid,uvcvideo type: USB
API: ALSA v: k7.1.10-200.fc44.x86_64 status: kernel-api
Server-1: PipeWire v: 1.6.8 status: active
Network:
Device-1: Intel Meteor Lake PCH CNVi WiFi driver: iwlwifi
IF: wlp0s20f3 state: up mac: 72:0a:be:77:31:f3
Device-2: Intel Ethernet I219-LM driver: e1000e
IF: enp0s31f6 state: down mac: c4:ef:bb:c5:15:5e
Device-3: Realtek RTL8153 Gigabit Ethernet Adapter driver: r8152 type: USB
IF: eth0 state: down mac: 38:7c:76:1c:d9:8f
IF-ID-1: br-1e855654a0a3 state: up speed: 10000 Mbps duplex: unknown
mac: 72:a4:74:64:35:f9
IF-ID-2: br-34ed068c0019 state: down mac: 9a:2c:b3:23:60:ce
IF-ID-3: br-5c7d2be1df0f state: down mac: 26:41:ee:b4:20:f8
IF-ID-4: br-79582b8ed55f state: down mac: 06:ac:f2:ab:3f:01
IF-ID-5: br-88ac2e8e4dfb state: down mac: a6:ee:f9:d4:46:01
IF-ID-6: br-912fb3dbd851 state: down mac: 3e:5a:9a:ad:be:d7
IF-ID-7: br-c22b385f01c6 state: down mac: f2:e0:6c:2a:85:5a
IF-ID-8: br-c804380998f5 state: down mac: 4a:e2:74:0f:03:76
IF-ID-9: docker0 state: down mac: d2:d6:a3:2b:5e:2b
IF-ID-10: veth924b1f0 state: up speed: 10000 Mbps duplex: full
mac: 42:24:b7:94:1a:1c
IF-ID-11: vethcd20cd9 state: up speed: 10000 Mbps duplex: full
mac: 42:b6:50:9f:20:8a
IF-ID-12: virbr1 state: up speed: 10000 Mbps duplex: unknown
mac: 52:54:00:27:9f:4a
IF-ID-13: vnet0 state: unknown speed: 10000 Mbps duplex: full
mac: fe:54:00:02:36:e5
IF-ID-14: vnet1 state: unknown speed: 10000 Mbps duplex: full
mac: fe:54:00:02:36:e5
Bluetooth:
Device-1: Intel AX211 Bluetooth driver: btusb type: USB
Report: btmgmt ID: hci0 state: up address: EC:4C:8C:34:99:9A bt-v: 5.4
Drives:
Local Storage: total: 1.39 TiB used: 233.84 GiB (16.5%)
ID-1: /dev/nvme0n1 vendor: KIOXIA model: N/A size: 953.87 GiB
ID-2: /dev/sda vendor: JMicron Tech model: N/A size: 465.76 GiB type: USB
Partition:
ID-1: / size: 295.09 GiB used: 232.44 GiB (78.8%) fs: btrfs dev: /dev/dm-0
ID-2: /boot size: 1.9 GiB used: 1.36 GiB (71.5%) fs: ext4
dev: /dev/nvme0n1p6
ID-3: /boot/efi size: 96 MiB used: 38.4 MiB (40.0%) fs: vfat
dev: /dev/nvme0n1p1
ID-4: /home size: 295.09 GiB used: 232.44 GiB (78.8%) fs: btrfs
dev: /dev/dm-0
Swap:
ID-1: swap-1 type: zram size: 8 GiB used: 0 KiB (0.0%) dev: /dev/zram0
Sensors:
System Temperatures: cpu: 43.0 C mobo: N/A
Fan Speeds (rpm): fan-1: 2587 fan-2: 2596
Info:
Memory: total: 64 GiB available: 62.29 GiB used: 19.44 GiB (31.2%)
Processes: 564 Uptime: 2d 17h 48m Shell: Bash inxi: 3.3.41

add a swap file or partition

reliance on zram is likely your issue.

Not sure there’s enough evidence to conclude that. Or at least, I would be surprised if that turned out to be the whole story. Using only Zram blocks hibernation, but I’m not aware of this causing issues with screens.

Also, when using Zram, you should not add a swapfile as this is counter-productive with Zram. If you want a swapfile or partition, you should switch to use Zswap and stop using Zram. But this is a complex path that I wouldn’t recommend that a non-expert go down.

OP, make sure Distributions/Packaging Recommendations - KDE Community Wiki is all applied on your system.

Also, can you clarify exactly what “the screens are messed up” means?