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 688589 - overview: Fix stuck grabs when mashing the overlay-key
overview: Fix stuck grabs when mashing the overlay-key
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
Depends on:
Blocks:
 
 
Reported: 2012-11-18 15:50 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2012-12-10 19:39 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
overview: Fix stuck grabs when mashing the overlay-key (1.21 KB, patch)
2012-11-18 15:50 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
overview: Clean up overview code (1.08 KB, patch)
2012-12-10 09:02 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2012-11-18 15:50:16 UTC
See patch. Found this while trying to reproduce a crash for
ricotz and the new theme node stuff. I've seen a few commits
about stuck grabs -- this may fix one of them.
Comment 1 Jasper St. Pierre (not reading bugmail) 2012-11-18 15:50:18 UTC
Created attachment 229292 [details] [review]
overview: Fix stuck grabs when mashing the overlay-key

When pressing the overlay key three times, things went like this:

  * show(), push a modal
  * hide(), will pop a modal after hiding is done
  * show(), push a modal

Thus, when the showing is done, and then it activated the hiding,
it popped one modal, but not the other. This patch changes things
to be:

  * show(), push a modal
  * hide(), will pop a modal after hiding is done
  * hide(), no-op

That is, mashing the overlay-key when it's showing will always make
it hide, not mashing an odd number of times.
Comment 2 Rui Matos 2012-11-18 18:15:33 UTC
Review of attachment 229292 [details] [review]:

I don't really like this. I think the problem is show() pushing modals without checking if it's already modal, i.e. something like:

-        // Do this manually instead of using _syncInputMode, to handle failure
-        if (!Main.pushModal(this._group, { keybindingMode: Main.KeybindingMode.OVERVIEW }))
+
+        this._shown = true;
+        this._syncInputMode();
+        if (!this._modal)
             return;
-        this._modal = true;
+
         this._animateVisible();
-        this._shown = true;
Comment 3 Jasper St. Pierre (not reading bugmail) 2012-11-18 18:30:01 UTC
Yeah, my original patch looked like that, but during testing it was weird to have the "press three times, still in overview". And at that point, the original bug was "fixed", so I removed that part of the patch.
Comment 4 Giovanni Campagna 2012-11-27 22:54:00 UTC
Sorry, but I don't understand why pressing three times slowly should make any difference from pressing three times fast. The sequence is show-hide-show, it is clear from any point of view.
And it complicates the code for nothing.
Comment 5 Jasper St. Pierre (not reading bugmail) 2012-11-27 23:00:14 UTC
(In reply to comment #4)
> Sorry, but I don't understand why pressing three times slowly should make any
> difference from pressing three times fast. The sequence is show-hide-show, it
> is clear from any point of view.
> And it complicates the code for nothing.

I think that if we press it while animating, it's clear that a user wants to exit no matter how many times they press it.
Comment 6 Rui Matos 2012-12-09 19:44:00 UTC
Review of attachment 229292 [details] [review]:

(In reply to comment #5)
> (In reply to comment #4)
> > Sorry, but I don't understand why pressing three times slowly should make any
> > difference from pressing three times fast. The sequence is show-hide-show, it
> > is clear from any point of view.
> > And it complicates the code for nothing.
> 
> I think that if we press it while animating, it's clear that a user wants to
> exit no matter how many times they press it.

Fair enough, go ahead.
Comment 7 Jasper St. Pierre (not reading bugmail) 2012-12-10 09:02:22 UTC
Created attachment 231121 [details] [review]
overview: Clean up overview code

The comment here is a liar. We certainly can handle failure
using _syncInputMode().
Comment 8 Rui Matos 2012-12-10 12:49:23 UTC
Review of attachment 231121 [details] [review]:

Yeah, this seems better to me.
Comment 9 Jasper St. Pierre (not reading bugmail) 2012-12-10 19:39:15 UTC
Attachment 229292 [details] pushed as 14fb51e - overview: Fix stuck grabs when mashing the overlay-key
Attachment 231121 [details] pushed as e48dbe6 - overview: Clean up overview code