[gedit-plugins] [multiedit] Correctly compute event coordinate rect
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins] [multiedit] Correctly compute event coordinate rect
- Date: Sat, 6 Sep 2014 10:23:05 +0000 (UTC)
commit 61272c40e01f05d390a75e75c37f97de1653fd86
Author: Jesse van den Kieboom <jessevdk gmail com>
Date: Sat Sep 6 12:20:55 2014 +0200
[multiedit] Correctly compute event coordinate rect
plugins/multiedit/multiedit/viewactivatable.py | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/plugins/multiedit/multiedit/viewactivatable.py b/plugins/multiedit/multiedit/viewactivatable.py
index b20fe1b..204a0a1 100644
--- a/plugins/multiedit/multiedit/viewactivatable.py
+++ b/plugins/multiedit/multiedit/viewactivatable.py
@@ -1244,7 +1244,16 @@ class MultiEditViewActivatable(GObject.Object, Gedit.ViewActivatable, Signals):
if not self._in_mode:
return False
- geom = view.get_window(Gtk.TextWindowType.TOP).get_geometry()
+ win = view.get_window(Gtk.TextWindowType.TOP)
+ parent = win.get_parent()
+
+ while view.get_window_type(parent) != Gtk.TextWindowType.WIDGET:
+ parent = parent.get_parent()
+
+ wino = win.get_origin()
+ paro = parent.get_origin()
+
+ geom = (wino[1] - paro[1], wino[2] - paro[2], win.get_width(), win.get_height())
if x < geom[0] or x > geom[0] + geom[2] or y < geom[1] or y > geom[1] + geom[3]:
return False
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]