diff options
author | Gonzalo Odiard <godiard@gmail.com> | 2013-05-27 15:37:21 (GMT) |
---|---|---|
committer | Gonzalo Odiard <godiard@gmail.com> | 2013-05-27 15:37:21 (GMT) |
commit | fb2106a3e513276b981e73eba125e69a80c5290d (patch) | |
tree | 7f023145d4e24333b368b40c03696576f6896678 | |
parent | 4fbf089860509abe9920ccc170d417249c816669 (diff) |
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 <gonzalo@laptop.org>
-rw-r--r-- | AbiWordActivity.py | 25 |
1 files changed, 8 insertions, 17 deletions
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 |