Magnifier: fix a warning when calling setActive() with the same value
We must not call enable/disable_unredirect if we didn't change the active value, otherwise mutter gets confused and emits warnings. https://bugzilla.gnome.org/show_bug.cgi?id=724293
This commit is contained in:
parent
f6240e114c
commit
3b0197620f
@ -105,17 +105,20 @@ const Magnifier = new Lang.Class({
|
|||||||
* @activate: Boolean to activate or de-activate the magnifier.
|
* @activate: Boolean to activate or de-activate the magnifier.
|
||||||
*/
|
*/
|
||||||
setActive: function(activate) {
|
setActive: function(activate) {
|
||||||
|
let isActive = this.isActive();
|
||||||
|
|
||||||
this._zoomRegions.forEach (function(zoomRegion, index, array) {
|
this._zoomRegions.forEach (function(zoomRegion, index, array) {
|
||||||
zoomRegion.setActive(activate);
|
zoomRegion.setActive(activate);
|
||||||
});
|
});
|
||||||
|
|
||||||
if (activate) {
|
if (isActive != activate) {
|
||||||
Meta.disable_unredirect_for_screen(global.screen);
|
if (activate) {
|
||||||
this.startTrackingMouse();
|
Meta.disable_unredirect_for_screen(global.screen);
|
||||||
}
|
this.startTrackingMouse();
|
||||||
else {
|
} else {
|
||||||
Meta.enable_unredirect_for_screen(global.screen);
|
Meta.enable_unredirect_for_screen(global.screen);
|
||||||
this.stopTrackingMouse();
|
this.stopTrackingMouse();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure system mouse pointer is shown when all zoom regions are
|
// Make sure system mouse pointer is shown when all zoom regions are
|
||||||
|
Loading…
Reference in New Issue
Block a user