[gnome-shell/gnome-3-24] system: Emulate click action button release
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-24] system: Emulate click action button release
- Date: Thu, 13 Jul 2017 10:30:33 +0000 (UTC)
commit 31c9d2cf7ace5efb2ab7eff5412f560551fb0212
Author: Florian Müllner <fmuellner gnome org>
Date: Fri Jun 16 17:08:07 2017 +0200
system: Emulate click action button release
Since commit 2c070d38, we add a ClickAction to the visible AltSwitcher
button to track long-presses. As a result, we now have two components
that will grab and ungrab the pointer for the button, so to make sure
we don't end up with a stuck grab, we need to release the second's
component grab when the first activates.
Currently we only drop the StButton grab on long-press, we also need
to cancel any initiated long-press on click.
https://bugzilla.gnome.org/show_bug.cgi?id=781738
js/ui/status/system.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/status/system.js b/js/ui/status/system.js
index 92ccf4c..8f99865 100644
--- a/js/ui/status/system.js
+++ b/js/ui/status/system.js
@@ -42,9 +42,15 @@ const AltSwitcher = new Lang.Class({
_init: function(standard, alternate) {
this._standard = standard;
this._standard.connect('notify::visible', Lang.bind(this, this._sync));
+ if (this._standard instanceof St.Button)
+ this._standard.connect('clicked',
+ () => { this._clickAction.release(); });
this._alternate = alternate;
this._alternate.connect('notify::visible', Lang.bind(this, this._sync));
+ if (this._alternate instanceof St.Button)
+ this._alternate.connect('clicked',
+ () => { this._clickAction.release(); });
this._capturedEventId = global.stage.connect('captured-event', Lang.bind(this,
this._onCapturedEvent));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]