messageTray: Add a notification focus keybinding
At the moment, only the mouse can be used to focus and answer a chat notification. This adds a new keybinding (defaults to <Super>+n) to focus and expand the active notification. https://bugzilla.gnome.org/show_bug.cgi?id=652082
This commit is contained in:
@ -1519,6 +1519,10 @@ const MessageTray = new Lang.Class({
|
||||
new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
|
||||
Meta.KeyBindingFlags.NONE,
|
||||
Lang.bind(this, this.toggleAndNavigate));
|
||||
global.display.add_keybinding('focus-active-notification',
|
||||
new Gio.Settings({ schema: SHELL_KEYBINDINGS_SCHEMA }),
|
||||
Meta.KeyBindingFlags.NONE,
|
||||
Lang.bind(this, this._expandActiveNotification));
|
||||
|
||||
this._summaryItems = [];
|
||||
this._chatSummaryItemsCount = 0;
|
||||
@ -2338,6 +2342,13 @@ const MessageTray = new Lang.Class({
|
||||
notification.destroy(NotificationDestroyedReason.EXPIRED);
|
||||
},
|
||||
|
||||
_expandActiveNotification: function() {
|
||||
if (!this._notification)
|
||||
return;
|
||||
|
||||
this._expandNotification(false);
|
||||
},
|
||||
|
||||
_expandNotification: function(autoExpanding) {
|
||||
// Don't grab focus in notifications that are auto-expanded.
|
||||
if (!autoExpanding)
|
||||
|
Reference in New Issue
Block a user