I found this great applet called DockbarX, which more or less emulates the Windows 7 Superbar. I like it better than the "Window List" applet in all ways except one. The way it handles dual monitors. DockbarX assumes one instance of itself and collects windows from the entire "X Screen". In my case, I'm using Nvidia TwinView, which defines both monitors as one "X Screen" and gives "hints" to the WM about drawing widnows. All of these tools (wnck, xrandr, xwminfo) are seeing both monitors as screen0 and do not seem to have any knowledge about these hints.
$ xprop -root #(truncated)
- Code: Select all
_NET_NUMBER_OF_DESKTOPS(CARDINAL) = 1
_NET_CURRENT_DESKTOP(CARDINAL) = 0
_NET_DESKTOP_GEOMETRY(CARDINAL) = 7680, 2400
_NET_DESKTOP_VIEWPORT(CARDINAL) = 0, 1200
Here I can see I have 1 desktop (as defined by xorg) but I only have 4 viewports (2 x 1920x1200). I need to be able to differentiate the monitors.
I suppose a work around here would be to change my setup to xinerama but that would be going in the wrong direction. This should be possible with TwinView, I'm just not sure how.
The current code uses the wnck module which seems to be ignorant of multi monitors.
Thanks to the PyGTK docs, I was able to put together a proof of concept in distinguishing the monitors through code but I'm not sure how to create a list of window objects from it.
- Code: Select all
#!/usr/bin/python
import gtk
screen = gtk.gdk.screen_get_default()
print screen.get_n_monitors()
print screen.get_monitor_geometry(0)
The above will get me proper output, (2 monitors, proper geometry for monitor 0) but the screen object is different than wnck's so I cannot just replace:
- Code: Select all
self.screen = wnck.screen_get_default()
with
- Code: Select all
self.screen = gtk.gdk.screen_get_default()
Any suggestions, hints or tips are very much appreciated. I had a hint that maybe I can use XineramaQueryScreens() somehow but I'm not really sure how'd I'd be able to do that without coding a c program that gets called by python (if that would even work). Also had a hint that maybe dbus could be used... but I still have the problem with being able to distinguish the difference in monitors.
