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
master
Gonzalo Odiard 9 years ago
parent 16107a3985
commit 88213f6408

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

Loading…
Cancel
Save