From de7c5b90bde3b937f086d9a350bb5e1990cb5dcc Mon Sep 17 00:00:00 2001 From: Simon Schampijer Date: Thu, 1 Nov 2012 13:24:45 +0100 Subject: [PATCH] TrayIcon: set the touch mask on the event box, part of SL #4127 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We do need to add the mask if we want to receive the 'touch-event' signal. The Gtk.EventBox does set the touch event mask by default. [1] http://developer.gnome.org/gtk3/3.4/GtkWidget.html#GtkWidget-touch-event [2] http://git.gnome.org/browse/gtk+/tree/gtk/gtkeventbox.c#n411 Signed-off-by: Simon Schampijer Acked-by: Manuel QuiƱones --- src/sugar3/graphics/tray.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/sugar3/graphics/tray.py b/src/sugar3/graphics/tray.py index 82e1d979..0b3ca9ab 100644 --- a/src/sugar3/graphics/tray.py +++ b/src/sugar3/graphics/tray.py @@ -21,6 +21,7 @@ STABLE. from gi.repository import GObject from gi.repository import Gtk +from gi.repository import Gdk from sugar3.graphics import style from sugar3.graphics.palette import ToolInvoker @@ -409,6 +410,9 @@ class _IconWidget(Gtk.EventBox): GObject.GObject.__init__(self) self.set_app_paintable(True) + self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK | + Gdk.EventMask.TOUCH_MASK | + Gdk.EventMask.BUTTON_RELEASE_MASK) self._icon = Icon(icon_name=icon_name, xo_color=xo_color, icon_size=Gtk.IconSize.LARGE_TOOLBAR)