[gnome-shell] js/ui: Subscribe touchpad gesture handlers to only touchpad events
- From: Jonas Ådahl <jadahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] js/ui: Subscribe touchpad gesture handlers to only touchpad events
- Date: Sat, 29 Feb 2020 13:56:22 +0000 (UTC)
commit bd197789c1e28bea4361cca48c8e3ef940b1f460
Author: Daniel van Vugt <daniel van vugt canonical com>
Date: Fri Jan 10 15:44:35 2020 +0800
js/ui: Subscribe touchpad gesture handlers to only touchpad events
The touchpad gesture handlers were receiving all events, all the time.
This meant that even mouse movements were getting translated into
JavaScript calls and then discarded by the handlers, which wasted CPU.
Now we subscribe the touchpad gesture handlers to only touchpad events.
Prequisite: https://gitlab.gnome.org/GNOME/mutter/merge_requests/1000
Closes: https://gitlab.gnome.org/GNOME/mutter/issues/283
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/925
js/ui/swipeTracker.js | 2 +-
js/ui/viewSelector.js | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/js/ui/swipeTracker.js b/js/ui/swipeTracker.js
index 77536e4766..818d101938 100644
--- a/js/ui/swipeTracker.js
+++ b/js/ui/swipeTracker.js
@@ -58,7 +58,7 @@ const TouchpadSwipeGesture = GObject.registerClass({
this._orientation = Clutter.Orientation.VERTICAL;
this._enabled = true;
- global.stage.connect('captured-event', this._handleEvent.bind(this));
+ global.stage.connect('captured-event::touchpad', this._handleEvent.bind(this));
}
get enabled() {
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 8acea0c03d..5c0dd9bb75 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::touchpad', this._handleEvent.bind(this));
}
_handleEvent(actor, event) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]