GNOME Bugzilla – Bug 764133
Doesn't answer to Ctrl+Q or Ctrl+W
Last modified: 2017-01-19 13:05:09 UTC
It's not possible to close the helper with the keyboard.
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.
Created attachment 343651 [details] [review] portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Created attachment 343665 [details] [review] portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Created attachment 343666 [details] [review] portalHelper: Handle Ctrl+W/Ctrl+Q to close window
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.
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.
Created attachment 343731 [details] [review] portalHelper: Handle Ctrl+W/Ctrl+Q to close window
Review of attachment 343731 [details] [review]: LGTM
Attachment 343731 [details] pushed as d200fb1 - portalHelper: Handle Ctrl+W/Ctrl+Q to close window