Question

I'm trying to figure out how to detect when the current user has changed their workspace in Mono. I'm not even really sure how the workspace aspect of Gnome operates. A brief look through Monodoc didn't turn anything up, and I couldn't locate a GConf key that gave me what I wanted either.

Update: The method below will ONLY work if Compiz is not set to have a virtual size. For instance, if you set the number of desktops in Compiz to 1 with a horizontal virtual size of 2, Gdk.Global.CurrentDesktop will return 0 for both workspaces.

So does anyone know of a method for finding if the workspace has been changed when Compiz has virtual desktops enabled?

Was it helpful?

Solution

This is actually a feature of the window manager, and how exactly it works varies between window managers. I'm not familiar with how to access xlib in Mono, but you're looking for the _NET_NUMBER_OF_DESKTOPS, _NET_DESKTOP_NAMES, _NET_CURRENT_DESKTOP, etc. X properties on the root window.

FreeDesktop.org's Extended Window Manager Hints specification contains many of the details.

OTHER TIPS

Use libwnck. I am pretty sure there is a Mono wrapper for it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top