X11 virtual desktops: which are visible?

401 Views Asked by At

My Python program uses Xlib and Gtk3 and runs in an X-session with the window manager i3. I have 3 (real) monitors in this setup. i3 provides virtual desktops (and many other window managers behave similar here), at least 3 of them, as each monitor represents a desktop (on this standard setup). A monitor can have more desktops, but only one of them will be visible at a time.

I managed to move windows to any desktop:

gtk_window.get_window().move_to_desktop(2)

I can also distinguish on which monitor a desktop/window is:

x11display = Gdk.get_default_root_window().get_display()
x11monitor = x11display.get_monitor_at_window(gtk_window)
xid = GdkX11.X11Monitor.get_output(x11monitor)
# different xid → different monitor

But I found no way to see which desktop is visible whenever multiple desktops are associated with a monitor.

Any solution?

0

There are 0 best solutions below