Skip to content

Commit 5dbfa5c

Browse files
authored
screensheild.js: Listen to changes to allow floating setting (#13624)
We were only reading this setting at creation time. Instead read it on each activation in case the value changed. The timer to start widgets floating also wasn't getting started on first show.
1 parent 2b5851b commit 5dbfa5c

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

js/ui/screensaver/screenShield.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const POWER_SCHEMA = 'org.cinnamon.settings-daemon.plugins.power';
2222
const FADE_TIME = 200;
2323
const MOTION_THRESHOLD = 100;
2424

25-
const FLOAT_TIMER_INTERVAL = 30;
25+
const FLOAT_TIMER_INTERVAL = 5;
2626
const DEBUG_FLOAT = false; // Set to true for 5-second intervals during development
2727

2828
const MAX_SCREENSAVER_WIDGETS = 3;
@@ -136,7 +136,6 @@ var ScreenShield = GObject.registerClass({
136136
this._settings = new Gio.Settings({ schema_id: SCREENSAVER_SCHEMA });
137137
this._settings.connect('changed::lock-enabled', this._syncInhibitor.bind(this));
138138
this._powerSettings = new Gio.Settings({ schema_id: POWER_SCHEMA });
139-
this._allowFloating = this._settings.get_boolean('floating-widgets');
140139

141140
let constraint = new Clutter.BindConstraint({
142141
source: global.stage,
@@ -416,6 +415,7 @@ var ScreenShield = GObject.registerClass({
416415
this._lastMotionX = -1;
417416
this._lastMotionY = -1;
418417
this._activationTime = GLib.get_monotonic_time();
418+
this._allowFloating = this._settings.get_boolean('floating-widgets');
419419

420420
this._activationPending = true;
421421
_log('ScreenShield: requesting screensaver modal grab');
@@ -934,7 +934,7 @@ var ScreenShield = GObject.registerClass({
934934
this._assignRandomPositionToWidget(widget);
935935
widget.applyNextPosition();
936936

937-
if (this._widgets.length === 0) {
937+
if (this._widgets.length !== 0) {
938938
this._startFloatTimer();
939939
}
940940
}

0 commit comments

Comments
 (0)