After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 764133 - Doesn't answer to Ctrl+Q or Ctrl+W
Doesn't answer to Ctrl+Q or Ctrl+W
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: portal-helper
3.18.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2016-03-24 11:38 UTC by Bastien Nocera
Modified: 2017-01-19 13:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
portalHelper: Handle Ctrl+W/Ctrl+Q to close window (1.68 KB, patch)
2017-01-17 14:08 UTC, Bastien Nocera
none Details | Review
portalHelper: Handle Ctrl+W/Ctrl+Q to close window (1.82 KB, patch)
2017-01-17 17:35 UTC, Bastien Nocera
none Details | Review
portalHelper: Handle Ctrl+W/Ctrl+Q to close window (1.88 KB, patch)
2017-01-17 17:38 UTC, Bastien Nocera
none Details | Review
portalHelper: Handle Ctrl+W/Ctrl+Q to close window (1.19 KB, patch)
2017-01-18 16:16 UTC, Bastien Nocera
committed Details | Review

Description Bastien Nocera 2016-03-24 11:38:17 UTC
It's not possible to close the helper with the keyboard.
Comment 1 Bastien Nocera 2017-01-17 14:05:18 UTC
To test:

* Change the application ID in js/portalHelper/main.js :
-        this.parent({ application_id: 'org.gnome.Shell.PortalHelper',
+        this.parent({ application_id: 'org.gnome.Shell.PortalHelperX',

* Launch ./gnome-shell-portal-helper
* Activate the application :
gapplication launch org.gnome.Shell.PortalHelperX

Note, I'm still building a newer GTK+ to test this on Wayland.
Comment 2 Bastien Nocera 2017-01-17 14:08:15 UTC
Created attachment 343651 [details] [review]
portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Comment 3 Bastien Nocera 2017-01-17 17:35:58 UTC
Created attachment 343665 [details] [review]
portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Comment 4 Bastien Nocera 2017-01-17 17:38:28 UTC
Created attachment 343666 [details] [review]
portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Comment 5 Bastien Nocera 2017-01-17 17:39:57 UTC
Sorry about the churn. I realised that masking the modifiers we care about was nicer than removing one that we don't know exactly what it corresponds to.

This works in my testing.
Comment 6 Florian Müllner 2017-01-18 15:24:59 UTC
Review of attachment 343666 [details] [review]:

Alternatively, you could use the "modern" action API with something along the lines of:

let action = new Gio.SimpleAction({ name: 'quit' });
action.connect('activate', () => { this.active_window.destroy(); });
this.add_action(action);

this.set_accels_for_action('app.quit', ['<Primary>q', '<Primary>w']);

::: js/portalHelper/main.js
@@ +93,3 @@
+    _onKeyPressEvent: function(widget, event) {
+        let state = event.get_state();
+        if (!state[0])

A bit easier to read:
let [hasState, state] = event.get_state();
if (!hasState)
    ...

@@ +100,3 @@
+            return Gdk.EVENT_PROPAGATE;
+
+        let keyval = event.get_keyval()[1];

Dto.
Comment 7 Bastien Nocera 2017-01-18 16:16:25 UTC
Created attachment 343731 [details] [review]
portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Comment 8 Florian Müllner 2017-01-19 12:59:16 UTC
Review of attachment 343731 [details] [review]:

LGTM
Comment 9 Bastien Nocera 2017-01-19 13:05:03 UTC
Attachment 343731 [details] pushed as d200fb1 - portalHelper: Handle Ctrl+W/Ctrl+Q to close window