layout: Don't update the input region while we have a modal
If we have a modal, the stage's input region doesn't really matter -- all events go to us anyway. To avoid doing extra work doing animations when we have a modal, like menus, the overview, and the message tray, just fizzle out all updates. To make sure we catch updates, update the input region whenever we end a modal. https://bugzilla.gnome.org/show_bug.cgi?id=737001
This commit is contained in:
parent
778ef365d9
commit
0ca2fee54f
@ -259,7 +259,6 @@ const LayoutManager = new Lang.Class({
|
|||||||
|
|
||||||
this._inOverview = true;
|
this._inOverview = true;
|
||||||
this._updateVisibility();
|
this._updateVisibility();
|
||||||
this._updateRegions();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
hideOverview: function() {
|
hideOverview: function() {
|
||||||
@ -267,7 +266,6 @@ const LayoutManager = new Lang.Class({
|
|||||||
|
|
||||||
this._inOverview = false;
|
this._inOverview = false;
|
||||||
this._updateVisibility();
|
this._updateVisibility();
|
||||||
this._queueUpdateRegions();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
_sessionUpdated: function() {
|
_sessionUpdated: function() {
|
||||||
@ -915,9 +913,6 @@ const LayoutManager = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_queueUpdateRegions: function() {
|
_queueUpdateRegions: function() {
|
||||||
if (Main.sessionMode.isGreeter)
|
|
||||||
return;
|
|
||||||
|
|
||||||
if (this._startingUp)
|
if (this._startingUp)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -951,13 +946,16 @@ const LayoutManager = new Lang.Class({
|
|||||||
},
|
},
|
||||||
|
|
||||||
_updateRegions: function() {
|
_updateRegions: function() {
|
||||||
let rects = [], struts = [], i;
|
|
||||||
|
|
||||||
if (this._updateRegionIdle) {
|
if (this._updateRegionIdle) {
|
||||||
Meta.later_remove(this._updateRegionIdle);
|
Meta.later_remove(this._updateRegionIdle);
|
||||||
delete this._updateRegionIdle;
|
delete this._updateRegionIdle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// No need to update when we have a modal.
|
||||||
|
if (Main.modalCount > 0)
|
||||||
|
return GLib.SOURCE_REMOVE;
|
||||||
|
|
||||||
|
let rects = [], struts = [], i;
|
||||||
let isPopupMenuVisible = global.top_window_group.get_children().some(isPopupMetaWindow);
|
let isPopupMenuVisible = global.top_window_group.get_children().some(isPopupMetaWindow);
|
||||||
let wantsInputRegion = !isPopupMenuVisible;
|
let wantsInputRegion = !isPopupMenuVisible;
|
||||||
|
|
||||||
@ -1043,7 +1041,13 @@ const LayoutManager = new Lang.Class({
|
|||||||
}
|
}
|
||||||
|
|
||||||
return GLib.SOURCE_REMOVE;
|
return GLib.SOURCE_REMOVE;
|
||||||
}
|
},
|
||||||
|
|
||||||
|
modalEnded: function() {
|
||||||
|
// We don't update the stage input region while in a modal,
|
||||||
|
// so queue an update now.
|
||||||
|
this._queueUpdateRegions();
|
||||||
|
},
|
||||||
});
|
});
|
||||||
Signals.addSignalMethods(LayoutManager.prototype);
|
Signals.addSignalMethods(LayoutManager.prototype);
|
||||||
|
|
||||||
|
@ -454,6 +454,7 @@ function popModal(actor, timestamp) {
|
|||||||
if (modalCount > 0)
|
if (modalCount > 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
layoutManager.modalEnded();
|
||||||
global.end_modal(timestamp);
|
global.end_modal(timestamp);
|
||||||
Meta.enable_unredirect_for_screen(global.screen);
|
Meta.enable_unredirect_for_screen(global.screen);
|
||||||
keybindingMode = Shell.KeyBindingMode.NORMAL;
|
keybindingMode = Shell.KeyBindingMode.NORMAL;
|
||||||
|
Loading…
Reference in New Issue
Block a user