cleanup: Use type-safe comparisons

We have been using type-safe comparisons in new code for quite a while
now, however old code has only been adapted slowly.

Change all the remaining bits to get rid of another legacy style
difference.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/2866>
This commit is contained in:
Florian Müllner
2023-08-07 02:51:19 +02:00
committed by Marge Bot
parent 9a3913d4a0
commit a42f7c2384
94 changed files with 847 additions and 845 deletions

View File

@ -50,7 +50,7 @@ export class CtrlAltTabManager {
if (root instanceof St.Widget)
global.focus_manager.remove_group(root);
for (let i = 0; i < this._items.length; i++) {
if (this._items[i].root == root) {
if (this._items[i].root === root) {
this._items.splice(i, 1);
return;
}
@ -69,7 +69,7 @@ export class CtrlAltTabManager {
// they will have the same left-to-right ordering in the
// Ctrl-Alt-Tab dialog as they do onscreen.
_sortItems(a, b) {
if (a.sortGroup != b.sortGroup)
if (a.sortGroup !== b.sortGroup)
return a.sortGroup - b.sortGroup;
let [ax] = a.proxy.get_transformed_position();
@ -94,7 +94,7 @@ export class CtrlAltTabManager {
for (let i = 0; i < windows.length; i++) {
let icon = null;
let iconName = null;
if (windows[i].get_window_type() == Meta.WindowType.DESKTOP) {
if (windows[i].get_window_type() === Meta.WindowType.DESKTOP) {
iconName = 'video-display-symbolic';
} else {
let app = windowTracker.get_window_app(windows[i]);
@ -150,13 +150,13 @@ class CtrlAltTabPopup extends SwitcherPopup.SwitcherPopup {
}
_keyPressHandler(keysym, action) {
if (action == Meta.KeyBindingAction.SWITCH_PANELS)
if (action === Meta.KeyBindingAction.SWITCH_PANELS)
this._select(this._next());
else if (action == Meta.KeyBindingAction.SWITCH_PANELS_BACKWARD)
else if (action === Meta.KeyBindingAction.SWITCH_PANELS_BACKWARD)
this._select(this._previous());
else if (keysym == Clutter.KEY_Left)
else if (keysym === Clutter.KEY_Left)
this._select(this._previous());
else if (keysym == Clutter.KEY_Right)
else if (keysym === Clutter.KEY_Right)
this._select(this._next());
else
return Clutter.EVENT_PROPAGATE;