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 688196 - In the overview, dismissing the run-dialog also closes the overview
In the overview, dismissing the run-dialog also closes the overview
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 688885 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2012-11-12 18:15 UTC by Florian Müllner
Modified: 2012-11-28 21:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
modalDialog: Also block key-press events for button actions (1.66 KB, patch)
2012-11-12 18:15 UTC, Florian Müllner
none Details | Review
modalDialog: Also block key-press events for button actions (1.65 KB, patch)
2012-11-22 19:28 UTC, Florian Müllner
reviewed Details | Review
viewSelector: Ignore key-presses during non-overview modals (1.25 KB, patch)
2012-11-26 15:38 UTC, Florian Müllner
committed Details | Review

Description Florian Müllner 2012-11-12 18:15:29 UTC
This is a regression from 0c807bddaf4da5 - we now rely on ModalDialog to handle the Escape key, but as that uses the key-release event, the key-press is processed normally by the viewSelector now.
Comment 1 Florian Müllner 2012-11-12 18:15:32 UTC
Created attachment 228801 [details] [review]
modalDialog: Also block key-press events for button actions

As we handle actions on key-release, we currently allow other listeners
to process the same keys on key-press for something else - for instance,
when opening the run dialog in the overview, Escape will dismiss the
dialog on release, while the corresponding press will close the
overview.
Keep handling actions on key-release, but make sure to eat the
corresponding key-press as well to avoid those side effects.
Comment 2 Florian Müllner 2012-11-22 19:21:14 UTC
*** Bug 688885 has been marked as a duplicate of this bug. ***
Comment 3 Florian Müllner 2012-11-22 19:28:00 UTC
Created attachment 229654 [details] [review]
modalDialog: Also block key-press events for button actions

Rebased to master
Comment 4 Rui Matos 2012-11-23 10:32:40 UTC
Review of attachment 229654 [details] [review]:

Why are events reaching anything below the modal dialog? Shouldn't we have something like

this._group.connect('event', function() { return true; });

when !this._shellReactive ? Or maybe even guaranteeing that should be pushModal()'s job?
Comment 5 Florian Müllner 2012-11-26 15:38:27 UTC
Created attachment 229909 [details] [review]
viewSelector: Ignore key-presses during non-overview modals

Since commit 0c807bddaf4d, the run dialog no longer handles Escape
key presses itself but uses the action key mechanism of modal dialogs.
As the latter uses key-release events, our own handling of the Escape
key runs on key-press.
Fix this by bailing out early if anything has pushed a modal in addition
to the overview (like system modals, looking glass, ...).


(In reply to comment #4)
> Why are events reaching anything below the modal dialog?

Because it's hard I guess - also in the case of key presses, there's not really a "below" :-)

(in the case of modal dialogs, the (normal) actor hierarchy is stage->Main.uiGroup->modalDialog, e.g. not too many possibilities to hook into event bubbling)


> Shouldn't we have something like
> 
> this._group.connect('event', function() { return true; });
> 
> when !this._shellReactive ?

Well, that would fix the problem at hand, but introduce different ones. Most notably that button keys are no longer handled at all (something like

this._group.connect('event',
                    function(actor, event) {
                        return event.type() != Clutter.EventType.KEY_RELEASE;
                    });

should work, but meh ...)


> Or maybe even guaranteeing that should be pushModal()'s job?

I don't see how that would be done, except by using Clutter.grab_keyboard() instead of global.stage.set_key_focus(), which is discouraged by the Clutter documentation and would break all over the place (e.g. everywhere where we expect some actor not directly passed to Main.pushModal() to receive keyboard events, e.g. the overview's search entry, entries in system modals / notifications, ...)


Anyway, here's an alternative approach ...
Comment 6 Rui Matos 2012-11-28 20:07:47 UTC
Review of attachment 229909 [details] [review]:

Right, this isn't as easy as I thought. Anyway I like this one better, let's get this fixed.
Comment 7 Florian Müllner 2012-11-28 21:21:06 UTC
Attachment 229909 [details] pushed as 2a5eed1 - viewSelector: Ignore key-presses during non-overview modals