123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687 |
- From 81c17e5993001cf30d706642d67e09812136adf2 Mon Sep 17 00:00:00 2001
- From: Daniel van Vugt <daniel.van.vugt@canonical.com>
- Date: Fri, 2 Nov 2018 17:58:37 +0800
- Subject: [PATCH] js/ui: Use captured-event::nonmotion
- Cherry picked from commit 297a18f29a423da26fd86417e6c1fe82349d8f98.
- This new detail filters out mouse motion events so we don't waste CPU
- translating them all into JavaScript handlers that don't care about them.
- This helps with https://gitlab.gnome.org/GNOME/mutter/issues/283
- ---
- js/ui/padOsd.js | 2 +-
- js/ui/panel.js | 2 +-
- js/ui/status/system.js | 2 +-
- js/ui/viewSelector.js | 2 +-
- js/ui/windowManager.js | 2 +-
- 5 files changed, 5 insertions(+), 5 deletions(-)
- diff --git a/js/ui/padOsd.js b/js/ui/padOsd.js
- index a4af47297..6bff40849 100644
- --- a/js/ui/padOsd.js
- +++ b/js/ui/padOsd.js
- @@ -615,7 +615,7 @@ var PadOsd = class {
- this._settings = settings;
- this._imagePath = imagePath;
- this._editionMode = editionMode;
- - this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
- + this._capturedEventId = global.stage.connect('captured-event::nonmotion', this._onCapturedEvent.bind(this));
- this._padChooser = null;
-
- let deviceManager = Clutter.DeviceManager.get_default();
- diff --git a/js/ui/panel.js b/js/ui/panel.js
- index 16484850a..57f0778b1 100644
- --- a/js/ui/panel.js
- +++ b/js/ui/panel.js
- @@ -473,7 +473,7 @@ class ActivitiesButton extends PanelMenu.Button {
-
- this.actor.label_actor = this._label;
-
- - this.actor.connect('captured-event', this._onCapturedEvent.bind(this));
- + this.actor.connect('captured-event::nonmotion', this._onCapturedEvent.bind(this));
- this.actor.connect_after('key-release-event', this._onKeyRelease.bind(this));
-
- Main.overview.connect('showing', () => {
- diff --git a/js/ui/status/system.js b/js/ui/status/system.js
- index 1b0d10d8c..b25a6bf32 100644
- --- a/js/ui/status/system.js
- +++ b/js/ui/status/system.js
- @@ -23,7 +23,7 @@ var AltSwitcher = class {
- this._alternate.connect('clicked',
- () => { this._clickAction.release(); });
-
- - this._capturedEventId = global.stage.connect('captured-event', this._onCapturedEvent.bind(this));
- + this._capturedEventId = global.stage.connect('captured-event::nonmotion', this._onCapturedEvent.bind(this));
-
- this._flipped = false;
-
- diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
- index 77146552d..092ff8f1c 100644
- --- a/js/ui/viewSelector.js
- +++ b/js/ui/viewSelector.js
- @@ -44,7 +44,7 @@ function getTermsForSearchString(searchString) {
-
- var TouchpadShowOverviewAction = class {
- constructor(actor) {
- - actor.connect('captured-event', this._handleEvent.bind(this));
- + actor.connect('captured-event::nonmotion', this._handleEvent.bind(this));
- }
-
- _handleEvent(actor, event) {
- diff --git a/js/ui/windowManager.js b/js/ui/windowManager.js
- index b9f5fef46..97d980940 100644
- --- a/js/ui/windowManager.js
- +++ b/js/ui/windowManager.js
- @@ -461,7 +461,7 @@ var TouchpadWorkspaceSwitchAction = class {
- this._dx = 0;
- this._dy = 0;
- this._enabled = true;
- - actor.connect('captured-event', this._handleEvent.bind(this));
- + actor.connect('captured-event::nonmotion', this._handleEvent.bind(this));
- this._touchpadSettings = new Gio.Settings({schema_id: 'org.gnome.desktop.peripherals.touchpad'});
- }
-
- --
- 2.22.0
|