Maximum number of Virtual Desktop

Hi all,

In my workflow, I like having many virtual desktops.
Since I’m using them so much, I inevitably discovered that there is a hard-coded limit of 20 virtual desktops.

Does someone know why it is the case?
I would like to make this configurable to some extent.

I patched my KWin locally and it seems to handle more than that fine.

Thanks.

Hi @suwakommh,

I don’t think anybody remembers. That limit is there for atleast 12 years.

There is a open bug report for it though:

If you give a good enough reason why your workflow needs more than 20 virtual desktops, there might be a chance it can be changed.

My personal thoughts: Random UI elements might not be able to handle more than 20 virtual desktops (see the Overview effect who has even trouble with more than 10).

1 Like

I can also recommend to look into Activities.

I have 6 virtual desktops which I divide a bit like this

  1. chat
  2. email/calendar
  3. browser
  4. “IDE” (actual IDE, editor, image editor, etc)
  5. depends
  6. depends

I also have 4 Activities:

  1. Private
  2. Work
  3. Customer 1
  4. Customer 2

So when I am on Activity 3 / Desktop 4 I am looking at the IDE with a session for customer 1 project, same desktop Activity 4 is potentially even a different IDE.

Each browser has a profile matching the Activity.
Email/calendar is the same (window rule “show on all activities”).

Maybe your 20 desktop could be arranged/separated in a similar way?

3 Likes

An old tradition. Probably beginning whith Amiga in 1985 or vtwm in 1990 for unix.

@Duha Thank you for the lead!

I don’t know if my reason is good enough for the KWin maintainers. :upside_down_face:

But if no one has objections, my thinking is let users decide for themselves.

Since everyone is puzzled by why, I will explain my usecase.
I’d really like to have more than 20 virtual desktops, and I might not be the only one.

I hear that it could break some UI elements. I also noticed that the entries for the shortcuts expanded to match the maximum number of virtual desktops allowed. Which is why I’m wondering, why not make the maximum configurable ? Or maybe an obscurely configurable maximum through .config/ if it’s such an edge case. I don’t go in the shortcuts settings often, I don’t use the Overview effect, and I’d rather have my usecase for virtual desktops than a smaller shortcuts list, or an overview that looks okay. And if there is something I do mind, I could look into fixing it.

In any case, I will explain my use case.


@krake Thank you for the suggestion, but I am already using them haha.

I have a similar setup as you, @krake, for activities.
I usually run three:

  1. Dev (Browser window for git issues, a kate instance, an eclipse instance, another web browser to run the software I work on, and a konsole instance for logs)
  2. Work comms (KMail, Browser with Element and anything I open related to that, a password manager)
  3. Personal stuff (Browser with chats and other personal things, system monitor, a terminal for sysadmin stuff)

Sometimes I add more when I work on completely separate projects, within my work or outside of it. I have keybinds to add a new activities, to remove them, to move windows across activities, and to pin on all activities in some instances.

The way I use virtual desktops is probably quite different from the way you use them.
I try to have one window per virtual desktop.
This is because I don’t like to press alt-tab and struggle to find out if the window I’m looking at is the one I want.

Instead, I like to organize my windows in space. That way, I always know where my windows are: My terminal for my sysadmin stuff? That’s activity 3, leftmost desktop. My browser window where the project I work on is running? That’s activity 1, not the rightmost desktop, the one before that.

I have a KWin script for dynamic virtual desktops running. Unfortunately, this limits me to having only one row of desktops, because of a limitation in KWin’s scripting API.

So whenever I add a window on an empty virtual desktop, a new one is added to the right.
Works great with my workflow, I also have keybindings for moving windows around virtual desktops and it is very pleasant to organize.

With my current workflow, I don’t usually reach 20 virtual desktops.
They are shared across activities and this does increase the space a lot.

But I would like to have a 2D grid rather than just a stripe of virtual desktops.
So I made a merge request on KWin to fix the limitation in KWin’s scripting API and now I’m writing the KWin script to have a 2D dynamic virtual desktop grid using this.

The way this script would work / works is that there always is an empty row of virtual desktops ready to receive new windows.
So even if I use a row of 5 virtual desktops for 5 windows, I would have 10 or 15 windows depending on if I want an empty row both below and above the current one.
I would like to be able to expand in any direction and not be limited to using a 4x5 grid.
Even though in my use case, those virtual desktops might be quite sparse, I would like to be able to organize them as I wish without feeling like I have to cram everything together.

On the bug you linked to, @Duha, zzag says that one would need to have a very good memory in order to remember where everything is.
I think organizing it in space makes it very intuitive.

There is support for a grid of virtual desktops in KWin, and I’m really excited to use it!


My local patch for increasing the maximum number of virtual desktops or having a scriptable number of rows were small and I could kind of guess how to implement them.

But I don’t know KDE’s developement style and current overall structure on where to add potential configurations or all the implications of that change.

But people would find it much more difficult to “benefit” from my KWin script if that limit stayed hardcoded to 20 as is.

Ah, I see.

I try to do this as well, at most two per desktop.

But then again I also have 3 screens :slight_smile:

Definitely, during COVID it was a life-saver, one for the Office, another for School, and one for myself - then split some sub-divisions to separate desktops and you’re golden.

3 Likes