How to set screen panning with kscreen-doctor


I need to make my desktop smaller than my monitor’s native resolution. My monitor has developed a defect on the right hand size (nasty vertical lines), so I’d like to make the desktop smaller so that I avoid that area.

The monitor has a native resolution of 2560x1440 and I’ve found that I can pretty much achieve what I want with

xrandr --output DisplayPort-0 --fb 2150x1440  --panning 2150x1440+0+0/2150x1440+0+0/0/0/410/0

Can I achieve the same configuration with KDE tooling (e.g., kscreen-doctor) and have these settings persisted somehow?

ps: I wasn’t able to find any documentation for kscreen-doctor beyond its --help message.

Looking at src/doctor/doctor.cpp, the kscreen-doctor command supports a lot of stuff, but “panning” isn’t one of them.

Generally, you can run kscreen-doctor --outputs to get a detailed report about all the features that kscreen-doctor supports, and their values for each connected output, and you should be able to affect any of these features but not anything else.

I understand you are running on X11, but KDE development is currently focused on Wayland support and I don’t think that the KWin Wayland compositor supports panning - so adding that feature would be the best way to move forward.

Thanks for your reply.

So I read a bit more about it and “panning” is not really a thing anywhere in Wayland. The idea of “panning” is that you can have a larger display area than your screen and your screen will “pan” around the larger display area - either manually or mouse following or some such. It came out of the Xinerama project which was a primitive way to implement multi-screen on X11 - the X server would know about the screens an instead of telling the window manager about these and let the window manager understand “multiple screens”, it would present a larger display area covering all screens, and you can use either configuration or the XRANDR protocol to position the specific screen into the correct location. This obviously has been obsolete for a long while in favor of actual “multi-head” API where the the server exposes the fact that there are different screens to the window manager.

The way you use this feature to present a smaller display area than the size of the screen is kind of an abuse of the protocol, but if it works - :person_shrugging: that’s fine. allisfine

When Wayland was created to rethink the whole “how do we use modern hardware to display GUI” idea - panning was obviously not part of the equation, though eventually someone suggested a protocol that would allow functionality similar to XRANDR called zwlr_output_manager_v1 and a tool called wlr-randr that would manipulate it, and it looks to have similar capabilities allowing you to define a “mode” that has different physical size than the physical size of the screen - but this protocol is not currently implemented in KDE’s kwin, and as far as I can tell there are no plans to do so anytime soon.

Another option would be to create a custom EDID configuration that exposes a smaller screen size than your actual screen and force the kernel to use that instead of the EDID configuration of the actual screen - you can read more about it here, and some info about editing EDID to change mode lines here. This will even save you the use of xrandr on X11 and will make your setup future (wayland) proof. Disclaimer: I haven’t actually tried any of that.

It is obvious that KDE tools offer no support for this kind of finagling, but this is Linux and there are a lot of non-obvious things you can do. As long as you are OK with staying on X11 and the xrandr panning solution works for you - than great :+1: . If you do decide to move on to Wayland, and haven’t replaced your screen by then - please know that you have options.

Thanks for delving deeper into this and providing additional context and suggestions.

For the moment, my “abuse” of panning is successful at putting a band-aid on my problem. I’m not planning on switching to Wayland for now, but this solution is still not perfect: kscreen was working very well for me and the xrandr solution doesn’t provide that level of automatic configuration – which is kind of necessary, since I’m using a laptop.

I’ll look into the fake EDID solution. If I can create and load an “adjusted” EDID for my broken monitor, while not messing up interoperability with other displays, that could provide a robust solution. Otherwise, I’ve come across the autorandr project (phillipberndt/autorandr), which seems to semi-automate the application of different xrandr settings based on currently attached displays; that might be useful to substitute kscreen.

Thanks again for your suggestions.