[Sugar-devel] [PATCH v2 sugar] sugar-session: Check for already-running window manager on start-up
Sascha Silbe
silbe at activitycentral.com
Sat Jul 23 18:14:32 EDT 2011
This not only fixes a race condition (metacity is started before sugar-session
in sugar), but also allows running Sugar inside a different window manager.
Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
v1->v2: don't call callback directly
bin/sugar-session | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/bin/sugar-session b/bin/sugar-session
index 91ebf6f..4b714c3 100755
--- a/bin/sugar-session
+++ b/bin/sugar-session
@@ -259,16 +259,23 @@ def main():
screen = wnck.screen_get_default()
screen.connect('window-manager-changed', __window_manager_changed_cb)
+ _check_for_window_manager(screen)
try:
gtk.main()
except KeyboardInterrupt:
print 'Ctrl+C pressed, exiting...'
+
def __window_manager_changed_cb(screen):
+ _check_for_window_manager(screen)
+
+
+def _check_for_window_manager(screen):
wm_name = screen.get_window_manager_name()
if wm_name is not None:
screen.disconnect_by_func(__window_manager_changed_cb)
bootstrap()
+
main()
--
1.7.2.5
More information about the Sugar-devel
mailing list