diff options
author | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-17 22:44:23 (GMT) |
---|---|---|
committer | Marco Pesenti Gritti <marco@localhost.localdomain> | 2006-10-17 22:44:23 (GMT) |
commit | 03bca1037688dfe543f1fdb397f5626fdff78244 (patch) | |
tree | 86503de089e99cf851fe9179531d1089fcd5811f /shell | |
parent | 3cda316d11d8ae6916f124cd3800cfebf329df24 (diff) |
Listen also to enter event for frame activation. This makes
mouse activation actually reliable.
Diffstat (limited to 'shell')
-rw-r--r-- | shell/view/frame/Frame.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/shell/view/frame/Frame.py b/shell/view/frame/Frame.py index a48b6dd..3b264c6 100644 --- a/shell/view/frame/Frame.py +++ b/shell/view/frame/Frame.py @@ -72,23 +72,31 @@ class EventFrame(gobject.GObject): def _create_invisible(self, x, y, width, height): invisible = gtk.Invisible() invisible.connect('motion-notify-event', self._motion_notify_cb) + invisible.connect('enter-notify-event', self._enter_notify_cb) invisible.connect('leave-notify-event', self._leave_notify_cb) invisible.realize() invisible.window.set_events(gtk.gdk.POINTER_MOTION_MASK | + gtk.gdk.ENTER_NOTIFY_MASK | gtk.gdk.LEAVE_NOTIFY_MASK) invisible.window.move_resize(x, y, width, height) return invisible + def _enter_notify_cb(self, widget, event): + self._notify_enter(event.x, event.y) + def _motion_notify_cb(self, widget, event): + self._notify_enter(event.x, event.y) + + def _notify_enter(self, x, y): screen_w = gtk.gdk.screen_width() screen_h = gtk.gdk.screen_height() - if (event.x == 0 and event.y == 0) or \ - (event.x == 0 and event.y == screen_h - 1) or \ - (event.x == screen_w - 1 and event.y == 0) or \ - (event.x == screen_w - 1 and event.y == screen_h - 1): + if (x == 0 and y == 0) or \ + (x == 0 and y == screen_h - 1) or \ + (x == screen_w - 1 and y == 0) or \ + (x == screen_w - 1 and y == screen_h - 1): if self._hover != EventFrame.HOVER_CORNER: self._hover = EventFrame.HOVER_CORNER self.emit('enter-corner') |