MessageTray: pass keyboard events to tray icons

Synthetize XKeyEvents for clicks emulated by StButton using Return or
Space.

https://bugzilla.gnome.org/show_bug.cgi?id=687425
This commit is contained in:
Giovanni Campagna
2012-11-02 16:09:04 +01:00
parent 42c1285ead
commit 59ecd610b1
4 changed files with 45 additions and 26 deletions

View File

@@ -565,19 +565,17 @@ const Source = new Lang.Class({
this.notify(notification);
},
handleSummaryClick: function() {
handleSummaryClick: function(button) {
if (!this.trayIcon)
return false;
let event = Clutter.get_current_event();
if (event.type() != Clutter.EventType.BUTTON_RELEASE)
return false;
// Left clicks are passed through only where there aren't unacknowledged
// notifications, so it possible to open them in summary mode; right
// clicks are always forwarded, as the right click menu is not useful for
// tray icons
if (event.get_button() == 1 &&
if (button == 1 &&
this.notifications.length > 0)
return false;