Ticket #4127: 0001-TrayIcon-set-the-touch-mask-on-the-event-box.patch

File 0001-TrayIcon-set-the-touch-mask-on-the-event-box.patch, 1.2 KB (added by erikos, 11 years ago)

TrayIcon: set the touch mask on the event box

  • src/sugar3/graphics/tray.py

    From 3794306ef326df4d23463b69929d50d22217b309 Mon Sep 17 00:00:00 2001
    From: Simon Schampijer <simon@laptop.org>
    Date: Thu, 1 Nov 2012 13:24:45 +0100
    Subject: [PATCH toolkit-gtk3 1/2] TrayIcon: set the touch mask on the event
     box
    
    This is done in order to be able to receive touch
    events, on Gtk.EventBoxes the mask is not set by
    default.
    ---
     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 82e1d97..0b3ca9a 100644
    a b STABLE. 
    2121
    2222from gi.repository import GObject
    2323from gi.repository import Gtk
     24from gi.repository import Gdk
    2425
    2526from sugar3.graphics import style
    2627from sugar3.graphics.palette import ToolInvoker
    class _IconWidget(Gtk.EventBox): 
    409410        GObject.GObject.__init__(self)
    410411
    411412        self.set_app_paintable(True)
     413        self.add_events(Gdk.EventMask.BUTTON_PRESS_MASK |
     414                        Gdk.EventMask.TOUCH_MASK |
     415                        Gdk.EventMask.BUTTON_RELEASE_MASK)
    412416
    413417        self._icon = Icon(icon_name=icon_name, xo_color=xo_color,
    414418                          icon_size=Gtk.IconSize.LARGE_TOOLBAR)