summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Welsh <contact@evanwelsh.com>2021-07-14 20:19:45 -0700
committerEvan Welsh <contact@evanwelsh.com>2021-07-14 20:19:45 -0700
commit772c2203fdf9a3a0a117e409329a483e19f36963 (patch)
tree9c699e41f2cef9c2b51ab43c69ad4649d27f734d
parent7f7b515b84b6320cd6459ab5fd7154c54f70c4ae (diff)
downloadgnome-shell-ewlsh/javascript-fixes.tar.gz
Fix leftover and incorrect JavaScript.ewlsh/javascript-fixes
-rw-r--r--js/gdm/loginDialog.js2
-rw-r--r--js/ui/accessDialog.js4
-rw-r--r--js/ui/appDisplay.js3
-rw-r--r--js/ui/background.js4
-rw-r--r--js/ui/calendar.js4
-rw-r--r--js/ui/components/keyring.js2
-rw-r--r--js/ui/keyboard.js2
-rw-r--r--js/ui/magnifier.js25
-rw-r--r--js/ui/messageList.js2
-rw-r--r--js/ui/workspacesView.js3
10 files changed, 13 insertions, 38 deletions
diff --git a/js/gdm/loginDialog.js b/js/gdm/loginDialog.js
index d2a82b43d..760d7e9ef 100644
--- a/js/gdm/loginDialog.js
+++ b/js/gdm/loginDialog.js
@@ -602,7 +602,7 @@ var LoginDialog = GObject.registerClass({
let bannerAllocation = null;
let bannerHeight = 0;
if (this._bannerView.visible) {
- bannerAllocation = this._getBannerAllocation(dialogBox, this._bannerView);
+ bannerAllocation = this._getBannerAllocation(dialogBox);
bannerHeight = bannerAllocation.y2 - bannerAllocation.y1;
}
diff --git a/js/ui/accessDialog.js b/js/ui/accessDialog.js
index 057cd5b1b..7c8d69b80 100644
--- a/js/ui/accessDialog.js
+++ b/js/ui/accessDialog.js
@@ -76,10 +76,12 @@ class AccessDialog extends ModalDialog.ModalDialog {
}
open() {
- super.open();
+ if (!super.open())
+ return false;
let connection = this._invocation.get_connection();
this._requestExported = this._request.export(connection, this._handle);
+ return true;
}
CloseAsync(invocation, _params) {
diff --git a/js/ui/appDisplay.js b/js/ui/appDisplay.js
index f86a7bb67..832bd0261 100644
--- a/js/ui/appDisplay.js
+++ b/js/ui/appDisplay.js
@@ -2292,8 +2292,7 @@ class FolderView extends BaseAppView {
}
// Overridden from BaseAppView
- animate(animationDirection) {
- this._grid.animatePulse(animationDirection);
+ animate(_animationDirection) {
}
createFolderIcon(size) {
diff --git a/js/ui/background.js b/js/ui/background.js
index 1f7c5e572..3011fb2bb 100644
--- a/js/ui/background.js
+++ b/js/ui/background.js
@@ -177,7 +177,7 @@ var BackgroundCache = class BackgroundCache {
animation = new Animation({ file: params.file });
- animation.load(() => {
+ animation.loadAsync(() => {
this._animations[params.settingsSchema] = animation;
if (params.onLoaded) {
@@ -634,7 +634,7 @@ class Animation extends GnomeDesktop.BGSlideShow {
this.loaded = false;
}
- load(callback) {
+ loadAsync(callback) {
this.load_async(null, () => {
this.loaded = true;
if (callback)
diff --git a/js/ui/calendar.js b/js/ui/calendar.js
index 710efbac4..41caf43dc 100644
--- a/js/ui/calendar.js
+++ b/js/ui/calendar.js
@@ -297,7 +297,7 @@ class DBusEventSource extends EventSourceBase {
let changed = false;
for (const id of ids)
- changed |= this._events.delete(id);
+ changed = changed || this._events.delete(id);
if (changed)
this.emit('changed');
@@ -310,7 +310,7 @@ class DBusEventSource extends EventSourceBase {
let changed = false;
for (const id of this._events.keys()) {
if (id.startsWith(sourceUid))
- changed |= this._events.delete(id);
+ changed = changed || this._events.delete(id);
}
if (changed)
diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js
index 8623f2fdd..cd7a81e95 100644
--- a/js/ui/components/keyring.js
+++ b/js/ui/components/keyring.js
@@ -76,7 +76,7 @@ class KeyringDialog extends ModalDialog.ModalDialog {
warning.opacity = this.prompt.warning_visible ? 255 : 0;
});
this.prompt.connect('notify::warning', () => {
- if (this._passwordEntry && warning !== '')
+ if (this._passwordEntry && this.prompt.warning !== '')
Util.wiggle(this._passwordEntry);
});
warningBox.add_child(warning);
diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js
index bc72d77f3..062ba6e0b 100644
--- a/js/ui/keyboard.js
+++ b/js/ui/keyboard.js
@@ -561,7 +561,7 @@ var FocusTracker = class {
this._setCurrentWindow(global.display.focus_window);
- this._grabOpBeginId = global.display.connect('grab-op-begin', (display, window, op) => {
+ this._grabOpBeginId = global.display.connect('grab-op-begin', (_, display, window, op) => {
if (window == this._currentWindow &&
(op == Meta.GrabOp.MOVING || op == Meta.GrabOp.KEYBOARD_MOVING))
this.emit('window-grabbed');
diff --git a/js/ui/magnifier.js b/js/ui/magnifier.js
index 08466b9a0..307067909 100644
--- a/js/ui/magnifier.js
+++ b/js/ui/magnifier.js
@@ -221,7 +221,7 @@ var Magnifier = class Magnifier {
* @returns {bool} whether the magnifier is currently tracking the mouse
*/
isTrackingMouse() {
- return !!this._mouseTrackingId;
+ return !!this._pointerWatch;
}
/**
@@ -371,20 +371,6 @@ var Magnifier = class Magnifier {
}
/**
- * getCrosshairsColor:
- * Get the color of the crosshairs.
- * @returns {string} The color as a string, e.g. '#0000ffff' or 'blue'.
- */
- getCrosshairsColor() {
- if (this._crossHairs) {
- let clutterColor = this._crossHairs.getColor();
- return clutterColor.to_string();
- } else {
- return '#00000000';
- }
- }
-
- /**
* setCrosshairsThickness:
* Set the crosshairs thickness for all ZoomRegions.
* @param {number} thickness: The width of the vertical and
@@ -1766,15 +1752,6 @@ class Crosshairs extends Clutter.Actor {
}
/**
- * getColor:
- * Get the color of the crosshairs.
- * @returns {ClutterColor} the crosshairs color
- */
- getColor() {
- return this._horizLeftHair.get_color();
- }
-
- /**
* setThickness:
* Set the width of the vertical and horizontal lines of the crosshairs.
* @param {number} thickness: the new thickness value
diff --git a/js/ui/messageList.js b/js/ui/messageList.js
index 8ffdaebc1..c68ab77fd 100644
--- a/js/ui/messageList.js
+++ b/js/ui/messageList.js
@@ -22,7 +22,7 @@ function _fixMarkup(text, allowMarkup) {
_text = _text.replace(/<(?!\/?[biu]>)/g, '&lt;');
try {
- Pango.parse_markup(_text, -1, '');
+ Pango.parse_markup(_text, -1, 0);
return _text;
} catch (e) {}
}
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 1d03e3131..baef2d384 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -484,9 +484,6 @@ class WorkspacesView extends WorkspacesViewBase {
}
_activeWorkspaceChanged(_wm, _from, _to, _direction) {
- if (this._scrolling)
- return;
-
this._scrollToActive();
}