Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-08-06 17:51:46 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-08-06 17:51:46 (GMT)
commita5a033158da70075b995a8ddff1a21d769286b71 (patch)
tree0bf4655940d037a6edf64c29dbfad20d43b4a60f
parentbb66c911b990c1f02fedd5ae8c3da59858142300 (diff)
Write canvas redraw glitch when locking open a secondary toolbar #1121
-rw-r--r--AbiWordActivity.py24
1 files changed, 19 insertions, 5 deletions
diff --git a/AbiWordActivity.py b/AbiWordActivity.py
index 86a9ad6..415253b 100644
--- a/AbiWordActivity.py
+++ b/AbiWordActivity.py
@@ -138,16 +138,30 @@ class AbiWordActivity (activity.Activity):
self.set_toolbar_box(toolbar_box)
self.set_canvas(self.abiword_canvas)
- #self.abiword_canvas.connect_after('map-event', self._map_event_cb)
+ self.abiword_canvas.connect_after('map-event', self.__map_event_cb)
self.abiword_canvas.show()
- def _map_event_cb(self, event, activity):
- logger.debug('_map_event_cb')
+ self._zoom_handler = self.abiword_canvas.connect("zoom", self.__zoom_cb)
+
+ def __zoom_cb(self, abi, zoom):
+ abi.disconnect(self._zoom_handler)
+
+ # XXX workarond code to redraw abi document on every resize, see #1121
+ def size_allocate_cb(abi, alloc):
+ zoom = abi.get_zoom_percentage()
+ abi.set_zoom_percentage(zoom)
+ abi.set_zoom_percentage(zoom)
+ abi.connect('size-allocate', size_allocate_cb)
+
+ def __map_event_cb(self, event, activity):
+ logger.debug('__map_event_cb')
# set custom keybindings for Write
logger.debug("Loading keybindings")
keybindings_file = os.path.join( get_bundle_path(), "keybindings.xml" )
- self.abiword_canvas.invoke_cmd('com.abisource.abiword.loadbindings.fromURI', keybindings_file, 0, 0)
+ self.abiword_canvas.invoke_cmd(
+ 'com.abisource.abiword.loadbindings.fromURI',
+ keybindings_file, 0, 0)
# no ugly borders please
self.abiword_canvas.set_property("shadow-type", gtk.SHADOW_NONE)
@@ -206,7 +220,7 @@ class AbiWordActivity (activity.Activity):
logger.debug('My Write activity was shared')
self.initiating = True
self._setup()
-
+
self._shared_activity.connect('buddy-joined', self._buddy_joined_cb)
self._shared_activity.connect('buddy-left', self._buddy_left_cb)