Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/home/HomeWindow.py
diff options
context:
space:
mode:
Diffstat (limited to 'shell/view/home/HomeWindow.py')
-rw-r--r--shell/view/home/HomeWindow.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/shell/view/home/HomeWindow.py b/shell/view/home/HomeWindow.py
index d8322c6..b4f94ef 100644
--- a/shell/view/home/HomeWindow.py
+++ b/shell/view/home/HomeWindow.py
@@ -52,6 +52,13 @@ class HomeWindow(gtk.Window):
self.connect('focus-in-event', self._focus_in_cb)
self.connect('focus-out-event', self._focus_out_cb)
+ self._enter_sid = self.connect('enter-notify-event',
+ self._enter_notify_event_cb)
+ self._leave_sid = self.connect('leave-notify-event',
+ self._leave_notify_event_cb)
+ self._motion_sid = self.connect('motion-notify-event',
+ self._motion_notify_event_cb)
+
self._home_box = HomeBox(shell)
self._friends_box = FriendsBox(shell)
self._mesh_box = MeshBox(shell)
@@ -62,6 +69,25 @@ class HomeWindow(gtk.Window):
self._transition_box.connect('completed',
self._transition_completed_cb)
+ def _enter_notify_event_cb(self, window, event):
+ if event.x != gtk.gdk.screen_width() / 2 or \
+ event.y != gtk.gdk.screen_height() / 2:
+ self._mouse_moved()
+
+ def _leave_notify_event_cb(self, window, event):
+ self._mouse_moved()
+
+ def _motion_notify_event_cb(self, window, event):
+ self._mouse_moved()
+
+ # We want to enable the XO palette only when the user
+ # moved away from the default mouse position (screen center).
+ def _mouse_moved(self):
+ self._home_box.enable_xo_palette()
+ self.disconnect(self._leave_sid)
+ self.disconnect(self._motion_sid)
+ self.disconnect(self._enter_sid)
+
def _key_release_cb(self, widget, event):
keyname = gtk.gdk.keyval_name(event.keyval)
if keyname == "Alt_L":