[gnome-shell] Magnifier: fix a warning when calling setActive() with the same value
- From: Giovanni Campagna <gcampagna src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] Magnifier: fix a warning when calling setActive() with the same value
- Date: Thu, 13 Feb 2014 18:43:43 +0000 (UTC)
commit 3b0197620fcd98de9be79f5245ca1079033563ee
Author: Giovanni Campagna <gcampagna src gnome org>
Date: Thu Feb 13 15:11:07 2014 +0100
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
js/ui/magnifier.js | 17 ++++++++++-------
1 files changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 96c12b2..81e3553 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -105,17 +105,20 @@ const Magnifier = new Lang.Class({
* @activate: Boolean to activate or de-activate the magnifier.
*/
setActive: function(activate) {
+ let isActive = this.isActive();
+
this._zoomRegions.forEach (function(zoomRegion, index, array) {
zoomRegion.setActive(activate);
});
- if (activate) {
- Meta.disable_unredirect_for_screen(global.screen);
- this.startTrackingMouse();
- }
- else {
- Meta.enable_unredirect_for_screen(global.screen);
- this.stopTrackingMouse();
+ if (isActive != activate) {
+ if (activate) {
+ Meta.disable_unredirect_for_screen(global.screen);
+ this.startTrackingMouse();
+ } else {
+ Meta.enable_unredirect_for_screen(global.screen);
+ this.stopTrackingMouse();
+ }
}
// Make sure system mouse pointer is shown when all zoom regions are
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]