Skip to content

Commit 19fa83f

Browse files
rcalixtemtwebster
authored andcommitted
Fix whitespace
1 parent 8b56f4d commit 19fa83f

File tree

1 file changed

+58
-58
lines changed

1 file changed

+58
-58
lines changed

js/ui/appSwitcher/appSwitcher.js

Lines changed: 58 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ function sortWindowsByUserTime(win1, win2) {
1717

1818
this.minimizedAwareAltTab = global.settings.get_boolean("alttab-minimized-aware");
1919
if (this.minimizedAwareAltTab) {
20-
let m1 = win1.minimized;
21-
let m2 = win2.minimized;
22-
if (m1 == m2) {
23-
return (t2 > t1) ? 1 : -1;
24-
}
25-
else {
26-
return m1 ? 1 : -1;
27-
}
20+
let m1 = win1.minimized;
21+
let m2 = win2.minimized;
22+
if (m1 == m2) {
23+
return (t2 > t1) ? 1 : -1;
24+
}
25+
else {
26+
return m1 ? 1 : -1;
27+
}
2828
}
2929
else {
30-
return (t2 > t1) ? 1 : -1;
30+
return (t2 > t1) ? 1 : -1;
3131
}
3232
}
3333

@@ -62,29 +62,29 @@ function getWindowsForBinding(binding) {
6262
for (let i in windowActors)
6363
windows.push(windowActors[i].get_meta_window());
6464

65-
windows = windows.filter( Main.isInteresting );
65+
windows = windows.filter(Main.isInteresting);
6666

67-
switch(binding.get_name()) {
67+
switch (binding.get_name()) {
6868
case 'switch-panels':
6969
case 'switch-panels-backward':
7070
// Switch between windows of all workspaces
71-
windows = windows.filter( matchSkipTaskbar );
71+
windows = windows.filter(matchSkipTaskbar);
7272
break;
7373
case 'switch-group':
7474
case 'switch-group-backward':
7575
// Switch between windows of the same application
7676
let focused = global.display.focus_window ? global.display.focus_window : windows[0];
77-
windows = windows.filter( matchWmClass, focused.get_wm_class() );
77+
windows = windows.filter(matchWmClass, focused.get_wm_class());
7878
this._showAllWorkspaces = global.settings.get_boolean("alttab-switcher-show-all-workspaces");
7979
if (!this._showAllWorkspaces) {
80-
windows = windows.filter( matchWorkspace, global.workspace_manager.get_active_workspace() );
80+
windows = windows.filter(matchWorkspace, global.workspace_manager.get_active_workspace());
8181
}
8282
break;
8383
default:
8484
// Switch between windows of current workspace
8585
this._showAllWorkspaces = global.settings.get_boolean("alttab-switcher-show-all-workspaces");
8686
if (!this._showAllWorkspaces) {
87-
windows = windows.filter( matchWorkspace, global.workspace_manager.get_active_workspace() );
87+
windows = windows.filter(matchWorkspace, global.workspace_manager.get_active_workspace());
8888
}
8989
break;
9090
}
@@ -100,7 +100,7 @@ function AppSwitcher() {
100100
}
101101

102102
AppSwitcher.prototype = {
103-
_init: function(binding) {
103+
_init: function (binding) {
104104
this._initialDelayTimeoutId = null;
105105
this._binding = binding;
106106
this._windows = getWindowsForBinding(binding);
@@ -124,7 +124,7 @@ AppSwitcher.prototype = {
124124
this._updateActiveMonitor();
125125
},
126126

127-
_setupModal: function() {
127+
_setupModal: function () {
128128
this._haveModal = Main.pushModal(this.actor);
129129
if (!this._haveModal) {
130130
// Probably someone else has a pointer grab, try again with keyboard only
@@ -161,57 +161,57 @@ AppSwitcher.prototype = {
161161
return this._haveModal;
162162
},
163163

164-
_popModal: function() {
164+
_popModal: function () {
165165
if (this._haveModal) {
166166
Main.popModal(this.actor);
167167
this._haveModal = false;
168168
}
169169
},
170170

171-
_show: function() {
171+
_show: function () {
172172
throw new Error("Abstract method _show not implemented");
173173
},
174174

175-
_hide: function() {
175+
_hide: function () {
176176
throw new Error("Abstract method _hide not implemented");
177177
},
178178

179-
_onDestroy: function() {
179+
_onDestroy: function () {
180180
throw new Error("Abstract method _onDestroy not implemented");
181181
},
182182

183-
_createList: function() {
183+
_createList: function () {
184184
throw new Error("Abstract method _createList not implemented");
185185
},
186186

187-
_updateList: function() {
187+
_updateList: function () {
188188
throw new Error("Abstract method _updateList not implemented");
189189
},
190190

191-
_selectNext: function() {
191+
_selectNext: function () {
192192
throw new Error("Abstract method _selectNext not implemented");
193193
},
194194

195-
_selectPrevious: function() {
195+
_selectPrevious: function () {
196196
throw new Error("Abstract method _selectPrevious not implemented");
197197
},
198198

199-
_onWorkspaceSelected: function() {
199+
_onWorkspaceSelected: function () {
200200
throw new Error("Abstract method _onWorkspaceSelected not implemented");
201201
},
202202

203-
_checkSwitchTime: function() {
203+
_checkSwitchTime: function () {
204204
return true;
205205
},
206206

207-
_setCurrentWindow: function(window) {
207+
_setCurrentWindow: function (window) {
208208
},
209209

210-
_next: function() {
210+
_next: function () {
211211
if (!this._windows)
212212
return;
213213

214-
if(this._windows.length <= 1) {
214+
if (this._windows.length <= 1) {
215215
this._currentIndex = 0;
216216
this._updateList(0);
217217
} else {
@@ -222,11 +222,11 @@ AppSwitcher.prototype = {
222222
this._setCurrentWindow(this._windows[this._currentIndex]);
223223
},
224224

225-
_previous: function() {
225+
_previous: function () {
226226
if (!this._windows)
227227
return;
228228

229-
if(this._windows.length <= 1) {
229+
if (this._windows.length <= 1) {
230230
this._currentIndex = 0;
231231
this._updateList(0);
232232
} else {
@@ -237,15 +237,15 @@ AppSwitcher.prototype = {
237237
this._setCurrentWindow(this._windows[this._currentIndex]);
238238
},
239239

240-
_select: function(index) {
240+
_select: function (index) {
241241
if (!this._windows)
242242
return;
243243

244244
this._currentIndex = index;
245245
this._setCurrentWindow(this._windows[this._currentIndex]);
246246
},
247247

248-
_updateActiveMonitor: function() {
248+
_updateActiveMonitor: function () {
249249
this._activeMonitor = null;
250250
if (!this._enforcePrimaryMonitor)
251251
this._activeMonitor = Main.layoutManager.currentMonitor;
@@ -255,7 +255,7 @@ AppSwitcher.prototype = {
255255
return this._activeMonitor;
256256
},
257257

258-
_keyPressEvent: function(actor, event) {
258+
_keyPressEvent: function (actor, event) {
259259
let modifiers = Cinnamon.get_event_state(event);
260260
let symbol = event.get_key_symbol();
261261
let keycode = event.get_key_code();
@@ -266,7 +266,7 @@ AppSwitcher.prototype = {
266266

267267
// Switch workspace
268268
if (modifiers & Clutter.ModifierType.CONTROL_MASK &&
269-
(symbol === Clutter.KEY_Right || symbol === Clutter.KEY_Left)) {
269+
(symbol === Clutter.KEY_Right || symbol === Clutter.KEY_Left)) {
270270
if (this._switchWorkspace(symbol))
271271
return true;
272272
}
@@ -293,14 +293,14 @@ AppSwitcher.prototype = {
293293
case Clutter.KEY_Right:
294294
case Clutter.KEY_Down:
295295
// Right/Down -> navigate to next preview
296-
if(this._checkSwitchTime())
296+
if (this._checkSwitchTime())
297297
this._next();
298298
return true;
299299

300300
case Clutter.KEY_Left:
301301
case Clutter.KEY_Up:
302302
// Left/Up -> navigate to previous preview
303-
if(this._checkSwitchTime())
303+
if (this._checkSwitchTime())
304304
this._previous();
305305
return true;
306306
}
@@ -310,7 +310,7 @@ AppSwitcher.prototype = {
310310
case Meta.KeyBindingAction.SWITCH_GROUP:
311311
case Meta.KeyBindingAction.SWITCH_WINDOWS:
312312
case Meta.KeyBindingAction.SWITCH_PANELS:
313-
if(this._checkSwitchTime()) {
313+
if (this._checkSwitchTime()) {
314314
// shift -> backwards
315315
if (modifiers & Clutter.ModifierType.SHIFT_MASK)
316316
this._previous();
@@ -321,15 +321,15 @@ AppSwitcher.prototype = {
321321
case Meta.KeyBindingAction.SWITCH_GROUP_BACKWARD:
322322
case Meta.KeyBindingAction.SWITCH_WINDOWS_BACKWARD:
323323
case Meta.KeyBindingAction.SWITCH_PANELS_BACKWARD:
324-
if(this._checkSwitchTime())
324+
if (this._checkSwitchTime())
325325
this._previous();
326326
return true;
327327
}
328328

329329
return true;
330330
},
331331

332-
_keyReleaseEvent: function(actor, event) {
332+
_keyReleaseEvent: function (actor, event) {
333333
let [x, y, mods] = global.get_pointer();
334334
let state = mods & this._modifierMask;
335335

@@ -342,17 +342,17 @@ AppSwitcher.prototype = {
342342
return true;
343343
},
344344

345-
_failedGrabAction: function() {
345+
_failedGrabAction: function () {
346346
if (!["coverflow", "timeline"].includes(global.settings.get_string('alttab-switcher-style'))) {
347347
this._keyReleaseEvent(null, null);
348348
}
349349
},
350350

351351
// allow navigating by mouse-wheel scrolling
352-
_scrollEvent: function(actor, event) {
352+
_scrollEvent: function (actor, event) {
353353
if (event.get_scroll_direction() == Clutter.ScrollDirection.SMOOTH)
354354
return Clutter.EVENT_STOP;
355-
if(this._checkSwitchTime()) {
355+
if (this._checkSwitchTime()) {
356356
actor.set_reactive(false);
357357
if (event.get_scroll_direction() == Clutter.ScrollDirection.UP)
358358
this._previous();
@@ -363,7 +363,7 @@ AppSwitcher.prototype = {
363363
return true;
364364
},
365365

366-
_disableHover : function() {
366+
_disableHover: function () {
367367
this._mouseActive = false;
368368

369369
if (this._motionTimeoutId != 0)
@@ -372,12 +372,12 @@ AppSwitcher.prototype = {
372372
this._motionTimeoutId = Mainloop.timeout_add(DISABLE_HOVER_TIMEOUT, Lang.bind(this, this._mouseTimedOut));
373373
},
374374

375-
_mouseTimedOut : function() {
375+
_mouseTimedOut: function () {
376376
this._motionTimeoutId = 0;
377377
this._mouseActive = true;
378378
},
379379

380-
_switchWorkspace: function(direction) {
380+
_switchWorkspace: function (direction) {
381381
if (global.workspace_manager.n_workspaces < 2)
382382
return false;
383383

@@ -398,11 +398,11 @@ AppSwitcher.prototype = {
398398
return true;
399399
},
400400

401-
_windowDestroyed: function(wm, actor) {
401+
_windowDestroyed: function (wm, actor) {
402402
this._removeDestroyedWindow(actor.meta_window);
403403
},
404404

405-
_removeDestroyedWindow: function(window) {
405+
_removeDestroyedWindow: function (window) {
406406
for (let i in this._windows) {
407407
if (window == this._windows[i]) {
408408
if (this._windows.length == 1)
@@ -427,31 +427,31 @@ AppSwitcher.prototype = {
427427
}
428428
},
429429

430-
_activateSelected: function() {
430+
_activateSelected: function () {
431431
const _window = this._windows[this._currentIndex]
432432
const workspace_num = _window.get_workspace().index();
433433
Main.activateWindow(_window, global.get_current_time(), workspace_num);
434434
this._warpMouse = global.settings.get_boolean("alttab-switcher-warp-mouse-pointer");
435435
if (this._warpMouse) {
436-
const rect = _window.get_frame_rect();
437-
const x = rect.x + rect.width / 2;
438-
const y = rect.y + rect.height / 2;
439-
this._pointer = Clutter.get_default_backend().get_default_seat().create_virtual_device(Clutter.InputDeviceType.POINTER_DEVICE);
440-
this._pointer.notify_absolute_motion(global.get_current_time(), x, y);
436+
const rect = _window.get_frame_rect();
437+
const x = rect.x + rect.width / 2;
438+
const y = rect.y + rect.height / 2;
439+
this._pointer = Clutter.get_default_backend().get_default_seat().create_virtual_device(Clutter.InputDeviceType.POINTER_DEVICE);
440+
this._pointer.notify_absolute_motion(global.get_current_time(), x, y);
441441
}
442442
if (!this._destroyed)
443443
this.destroy();
444444
},
445445

446-
_showDesktop: function() {
446+
_showDesktop: function () {
447447
for (let i in this._windows) {
448448
if (!this._windows[i].minimized)
449449
this._windows[i].minimize();
450450
}
451451
this.destroy();
452452
},
453453

454-
destroy: function() {
454+
destroy: function () {
455455
this._destroyed = true;
456456
this._popModal();
457457

@@ -460,7 +460,7 @@ AppSwitcher.prototype = {
460460
else
461461
this._hide();
462462

463-
if(this._initialDelayTimeoutId !== null && this._initialDelayTimeoutId > 0) {
463+
if (this._initialDelayTimeoutId !== null && this._initialDelayTimeoutId > 0) {
464464
Mainloop.source_remove(this._initialDelayTimeoutId);
465465
this._initialDelayTimeoutId = 0;
466466
}

0 commit comments

Comments
 (0)