(dx)
| 1262 | } |
| 1263 | |
| 1264 | _drift(dx) { |
| 1265 | if (dx === 0) { |
| 1266 | return; |
| 1267 | } |
| 1268 | if (this.drifting) { |
| 1269 | return; |
| 1270 | } |
| 1271 | this.drifting = true; |
| 1272 | |
| 1273 | // stop drifting on key_release |
| 1274 | Navigator.getActionDispatcher(DispatcherMode.KEYBOARD) |
| 1275 | .addKeyReleaseCallback(() => { |
| 1276 | Utils.timeout_remove(driftTimeout); |
| 1277 | this.drifting = null; |
| 1278 | }); |
| 1279 | |
| 1280 | Utils.timeout_remove(driftTimeout); |
| 1281 | driftTimeout = GLib.timeout_add(GLib.PRIORITY_DEFAULT, 1, () => { |
| 1282 | Gestures.update(this, dx, 1); |
| 1283 | this.selectedWindow = Gestures.findTargetWindow(this, dx < 0 ? -1 : 1); |
| 1284 | ensureViewport(this.selectedWindow, this); |
| 1285 | return true; |
| 1286 | }); |
| 1287 | } |
| 1288 | |
| 1289 | driftLeft() { this._drift(-1 * Settings.prefs.drift_speed); } |
| 1290 | driftRight() { this._drift(Settings.prefs.drift_speed); } |
no test coverage detected