EventIcon: only trigger 'activate' signal on principal button click

With the introduction of 'activate' signal on [1], and the use of that
signal in Sugar Home, we introduced a bug, now, pressing the secondary button
starts the activity instead of open the palette.
This patch solves the issue checking the putton pressed before send the signal.

[1] a19cf9ed27
This commit is contained in:
Gonzalo Odiard 2015-08-06 16:59:13 -03:00
parent 16107a3985
commit 88213f6408

View File

@ -762,6 +762,7 @@ class EventIcon(Gtk.EventBox):
self.set_palette(Palette(text)) self.set_palette(Palette(text))
def __button_release_event_cb(self, icon, event): def __button_release_event_cb(self, icon, event):
if event.button == 1:
alloc = self.get_allocation() alloc = self.get_allocation()
if 0 < event.x < alloc.width and 0 < event.y < alloc.height: if 0 < event.x < alloc.width and 0 < event.y < alloc.height:
self.emit('activate') self.emit('activate')