diff options
author | Eitan Isaacson <eitan@monotonous.org> | 2009-12-01 16:07:15 -0800 |
---|---|---|
committer | Eitan Isaacson <eitan@monotonous.org> | 2009-12-01 16:07:15 -0800 |
commit | f543b33e104cc63892f056f44a32172b545a9509 (patch) | |
tree | 4bbfdd262dfe06be8aa65d275df7d3b12cf249c3 | |
parent | 7b04e086f744aa88939d8ab7b3c5f7573c7484fb (diff) | |
download | caribou-f543b33e104cc63892f056f44a32172b545a9509.tar.gz |
seperate calculating position and moving
-rw-r--r-- | src/keyboard.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/keyboard.py b/src/keyboard.py index c132421..0511c5f 100644 --- a/src/keyboard.py +++ b/src/keyboard.py @@ -143,7 +143,7 @@ class CaribouHoverWindow(CaribouWindow): args = root_window.get_position() + root_window.get_size() return gdk.Rectangle(*args) - def _update_position(self, placement=None): + def _calculate_position(self, placement=None): root_bbox = self._get_root_bbox() placement = placement or self._default_placement @@ -156,7 +156,10 @@ class CaribouHoverWindow(CaribouWindow): x += placement.x.adjust_to_bounds(root_bbox, proposed_position) y += placement.y.adjust_to_bounds(root_bbox, proposed_position) - self.move(x, y) + return x, y + + def _update_position(self): + self.move(*self._calculate_position()) def _calculate_axis(self, axis_placement, root_bbox): bbox = root_bbox |