messageTray: Don't remove and re-add the focus group on button changes

https://bugzilla.gnome.org/show_bug.cgi?id=710115
This commit is contained in:
Jasper St. Pierre 2013-10-13 22:53:58 -04:00
parent 25fd23e703
commit 96aa33f4ef

View File

@ -848,7 +848,6 @@ const Notification = new Lang.Class({
// %action-invoked signal with @id as a parameter // %action-invoked signal with @id as a parameter
addButton: function(id, label) { addButton: function(id, label) {
if (!this._buttonBox) { if (!this._buttonBox) {
let box = new St.BoxLayout({ style_class: 'notification-actions' }); let box = new St.BoxLayout({ style_class: 'notification-actions' });
this.setActionArea(box, { x_expand: false, this.setActionArea(box, { x_expand: false,
y_expand: false, y_expand: false,
@ -856,6 +855,7 @@ const Notification = new Lang.Class({
y_fill: false, y_fill: false,
x_align: St.Align.END }); x_align: St.Align.END });
this._buttonBox = box; this._buttonBox = box;
global.focus_manager.add_group(this._buttonBox);
} }
let button = new St.Button({ can_focus: true }); let button = new St.Button({ can_focus: true });
@ -870,11 +870,7 @@ const Notification = new Lang.Class({
button.label = label; button.label = label;
} }
if (this._buttonBox.get_n_children() > 0)
global.focus_manager.remove_group(this._buttonBox);
this._buttonBox.add(button); this._buttonBox.add(button);
global.focus_manager.add_group(this._buttonBox);
button.connect('clicked', Lang.bind(this, this._onActionInvoked, id)); button.connect('clicked', Lang.bind(this, this._onActionInvoked, id));
this.updated(); this.updated();