Desktop-per-screen (multiple monitors improvements)

There's been a "small" upgrade to my desktop machine at work, and as a part of that I got my hands on a 1920x1080 Dell monitor and couldn't help placing it as a secondary monitor, rotated. And I couldn't help noticing various problems with this setup.

A screen rotated to become 1080x1920 should be quite useful for a developer - let's face it, 1920x1080 is often good just few displaying a narrow text column between two huge margins anyway (hello dot.kde.org and other sites), so why not rather use the extra size for the direction that matters. But in practice, it didn't quite work, not really. Getting (some) driver to work somewhat decently in this setup wasn't exactly trivial and even then, there were various problems and the extra monitor seemed more like added weight than useful addition.

There were bugs of course, the unusual geometry can lead to strange results pretty easily, with the center of the right monitor being at the same height like the bottom edge of the left monitor. But, more importantly, it didn't seem to work right as a whole. I use virtual desktops a lot, and each virtual desktop spans the whole area of all monitors combined. Which makes the monitors very dependent, linked together, and so trying to take advantage of them for viewing something results in a struggle to arranging windows properly.

So, this Hackweek came about in the right time to allow me to do something about it as my project. I have fixed a number of multi-monitor bugs that bothered me, and I have a usable implementation of a desktop-per-screen feature for KWin. My changes for it are in the KDE git repo in clones/{kdelibs|kde-workspace}/lunakl/desktopperscreen, and let's see how it works in practice.

The picture above is from my testing (the black is the dead area). After selecting either of screens as the active switching desktops switches just what that screen shows. That means that with this setup its much simpler to have e.g. 4 virtual desktops on the left screen for development and 2 virtual desktops on the right screen for documentation, and using keyboard shortcuts one can get rapidly to anything wanted quite easily.

Of course, there is still room for improvements, or perhaps better said fixes for this mode. It can quickly get confusing about which virtual desktop is shown on which screen, so the picture shows an applets I quickly hacked up for this (I needed it quick&easy, so this one is for Kor). The pager now also shows incorrect information, since now each virtual desktop spans just one screen, e.g. desktop 4 should be shown in pager as having the KWrite window in its bottom-right corner, like it is in reality.

But well, it works, or so it seems so. I'll add the patches to my 11.4 KDE packages in the home:llunak:my OBS repo, time to try it out for real.


And I noticed small bug in the setup as well.

Many does not even notice that the resolution is needed to be spoken by width X height. So 1920x1080 turns to 1080x1920 when rotated.

Same thing is with smartphones. They are not 800x480 but 480x800 as the vertical mode is the default one and not horizontal.

Need to add this to BKO for some update then later.

By fri13 at Tue, 10/04/2011 - 18:38

This is (almost) how I always thought multiple screens should work. Desktop per screen, and if you want to use the two screens as one big area you'd select adjacent desktops for the two. So if you have a traditional 2x2 virtual desktop grid you'd select, say, the top-left desktop for the screen on the left and the top-right one for the screen on the right, and then windows which extend past the right edge of the left desktop/screen would extend onto the desktop/screen on the right, and vice versa.

This does also get funky with different-sized and shaped screens though.

By Gábor Lehel at Wed, 10/05/2011 - 10:01