Ensure the window is realized before getting his xid

This commit is contained in:
Marco Pesenti Gritti 2007-04-27 00:55:23 +02:00
parent 6cc3e7acdb
commit c256958a9a
2 changed files with 3 additions and 7 deletions

View File

@ -24,11 +24,11 @@ import logging
import os
import gtk
import hippo
from sugar.presence import presenceservice
from sugar.activity.activityservice import ActivityService
from sugar.graphics.window import Window
from sugar.graphics.toolbox import ActivityToolbar
class Activity(Window, gtk.Container):
"""Base Activity class that all other Activities derive from."""
@ -74,12 +74,6 @@ class Activity(Window, gtk.Container):
self.toolbox.add_toolbar('Activity', activity_toolbar)
activity_toolbar.show()
# DEPRECATED It will be removed after 3-6-2007 stable image
def do_add(self, widget):
if self.child:
self.remove(self.child)
gtk.Window.do_add(self, widget)
def get_service_name(self):
"""Gets the activity service name."""
return os.environ['SUGAR_BUNDLE_SERVICE_NAME']

View File

@ -44,6 +44,8 @@ class ActivityService(dbus.service.Object):
The various methods exposed on dbus are just forwarded
to the client Activity object's equally-named methods.
"""
activity.realize()
xid = activity.window.xid
service_name = _ACTIVITY_SERVICE_NAME + '%d' % xid
object_path = _ACTIVITY_SERVICE_PATH + "/%s" % xid