Public bug reported: Hello, Using "python-wnck" to report and set the workspace/desktop number.
I have the following Python code. It first sets the current desktop/workspace (in the loop) and then tries to report the desktop number. The print "actual=", actual statement prints always the first desktop (eg. 0), It does not change. IT DOES NOT OBEY THE ws.activate(timestamp) command. Note: you must test this with Metacity Window Manager. It will not work with Compiz. Run $ metacity --replace # The code: import gtk, gobject, wnck import time class Cambiatore(object): def __init__(self): self.screen= wnck.screen_get_default() def cambia(self, next_ws): ws = self.screen.get_workspaces()[next_ws] timestamp = int(time.time()) ws.activate(timestamp) ws = self.screen.get_active_workspace() actual = self.screen.get_workspace_index(ws) print "actual=", actual gtk.main_quit() c = Cambiatore() # Supposing you have at least 4 virtual desktops. Loop'em. for i in range(4): gobject.idle_add(c.cambia, i) gtk.main() And why does it need this evet-loop thing ? DEEPLY COONFUUSING ! ProblemType: Bug Architecture: amd64 Date: Sun Mar 7 09:39:07 2010 DistroRelease: Ubuntu 9.10 InstallationMedia: Ubuntu 9.10 "Karmic Koala" - Release Candidate amd64 (20091020.3) NonfreeKernelModules: nvidia Package: python-wnck 2.28.0-0ubuntu1 ProcEnviron: PATH=(custom, user) LANG=en_US.UTF-8 SHELL=/bin/bash ProcVersionSignature: Ubuntu 2.6.31-20.57-generic SourcePackage: gnome-python-desktop Uname: Linux 2.6.31-20-generic x86_64 ** Affects: gnome-python-desktop (Ubuntu) Importance: Undecided Status: New ** Tags: amd64 apport-bug -- Wnck fails to report correct workspace number. Urgent! https://bugs.launchpad.net/bugs/533694 You received this bug notification because you are a member of Ubuntu Desktop Bugs, which is subscribed to gnome-python-desktop in ubuntu. -- desktop-bugs mailing list desktop-bugs@lists.ubuntu.com https://lists.ubuntu.com/mailman/listinfo/desktop-bugs