From fb2106a3e513276b981e73eba125e69a80c5290d Mon Sep 17 00:00:00 2001 From: Gonzalo Odiard Date: Mon, 27 May 2013 15:37:21 +0000 Subject: Fix collaboration - SL #4482 The problem was related to a race condition between the load of a file, and the start of the sharing session, that is the reason this was random, and appear a lot more in xo-4 than in other models. We used two callback methods, one connected to canvas map-event and another connected to activity map-event. This is not needed anymore, and removing the canvas map event callback simplify the operation, and solves the collaboration. Signed-off-by: Gonzalo Odiard --- diff --git a/AbiWordActivity.py b/AbiWordActivity.py index 7de5423..76e72c4 100644 --- a/AbiWordActivity.py +++ b/AbiWordActivity.py @@ -173,22 +173,6 @@ class AbiWordActivity(activity.Activity): self.set_canvas(overlay) - self.abiword_canvas.connect_after('map-event', self.__map_event_cb) - self.abiword_canvas.show() - self.connect_after('map-event', self.__map_activity_event_cb) - - self.abiword_canvas.connect('size-allocate', self.size_allocate_cb) - - def size_allocate_cb(self, abi, alloc): - logging.error('size allocate %s', alloc) - GObject.idle_add(abi.queue_draw) - - def __map_event_cb(self, event, activity): - logger.debug('__map_event_cb abi') - - # no ugly borders please - #self.abiword_canvas.set_property("shadow-type", Gtk.ShadowType.NONE) - # we want a nice border so we can select paragraphs easily self.abiword_canvas.set_show_margin(True) @@ -211,12 +195,19 @@ class AbiWordActivity(activity.Activity): self._buddy_joined_cb) self.shared_activity.connect('buddy-left', self._buddy_left_cb) if self.get_shared(): -# # oh, OK, we've already joined self._joined_cb(self) else: # we are creating the activity logger.error("We are creating an activity") + self.abiword_canvas.show() + self.connect_after('map-event', self.__map_activity_event_cb) + + self.abiword_canvas.connect('size-allocate', self.size_allocate_cb) + + def size_allocate_cb(self, abi, alloc): + GObject.idle_add(abi.queue_draw) + def __map_activity_event_cb(self, event, activity): # set custom keybindings for Write # we do it later because have problems if done before - OLPC #11049 -- cgit v0.9.1