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 740237 - SelectArea unnecessarily opens the overview
SelectArea unnecessarily opens the overview
Status: RESOLVED FIXED
Product: gnome-shell
Classification: Core
Component: general
3.14.x
Other Linux
: Normal normal
: ---
Assigned To: gnome-shell-maint
gnome-shell-maint
: 739743 741474 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2014-11-17 06:56 UTC by Mantas Mikulėnas (grawity)
Modified: 2014-12-19 12:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
demo (623.60 KB, video/webm)
2014-11-17 06:59 UTC, Mantas Mikulėnas (grawity)
  Details
edgeDragAction: Restrict action based on keybindingMode (3.22 KB, patch)
2014-11-27 19:54 UTC, Florian Müllner
reviewed Details | Review
Rename KeyBindingMode to ActionMode (42.62 KB, patch)
2014-12-11 15:15 UTC, Florian Müllner
none Details | Review
gestures: Restrict actions based on keybindingMode (4.55 KB, patch)
2014-12-11 15:57 UTC, Florian Müllner
committed Details | Review
Rename KeyBindingMode to ActionMode (43.79 KB, patch)
2014-12-11 16:17 UTC, Florian Müllner
committed Details | Review

Description Mantas Mikulėnas (grawity) 2014-11-17 06:56:45 UTC
Here's a weird bug.

1. Invoke the "area selection", e.g. by using the "screenshot area" shortcut key, or by directly calling SelectArea:

gdbus call -e -d org.gnome.Shell \
      -o /org/gnome/Shell/Screenshot \
      -m org.gnome.Shell.Screenshot.SelectArea

2. Start selecting at the left edge of the screen (x <= 20, roughly), and drag towards bottom-right. (Doesn't happen when dragging towards top-right.)

3. Notice that the overview will open by itself before the screenshot is made... as if I'd accidentally touched the hot corner, or something. (Therefore causing the screenshot to just contain part of the overview.)

gnome-shell 3.15.1-29-g487b5cd
Comment 1 Mantas Mikulėnas (grawity) 2014-11-17 06:59:48 UTC
Created attachment 290833 [details]
demo
Comment 2 Florian Müllner 2014-11-27 17:42:37 UTC
Reproduced here on 3.14.x and master, the problem is the overview edge-drag action triggering erroneously. Carlos offered to take a look ...
Comment 3 Florian Müllner 2014-11-27 19:54:40 UTC
Created attachment 291677 [details] [review]
edgeDragAction: Restrict action based on keybindingMode

Just like keybindings and the message tray pointer barrier, gestures
don't always make sense - for instance, swiping up the screen shield
should not trigger the message tray just as the SelectArea action around
the left edge should not open the overview.
To avoid this, restrict gestures based on the current keybinding mode.
Comment 4 Florian Müllner 2014-11-27 19:56:25 UTC
*** Bug 739743 has been marked as a duplicate of this bug. ***
Comment 5 Carlos Garnacho 2014-12-11 12:58:56 UTC
Review of attachment 291677 [details] [review]:

I find the solution quite elegant, certainly gestures share a lot with keybindings in this regard, too bad even that there's no common gesture JS subclass so this applies to all :(. 

This is probably a symptom that ShellKeyBindingMode has outperformed its expectatives though, maybe should be better renamed to ShellActionMode in the future? This patch should go in nonetheless IMO.
Comment 6 Florian Müllner 2014-12-11 15:15:50 UTC
Created attachment 292537 [details] [review]
Rename KeyBindingMode to ActionMode

The keybinding mode is no longer used exclusively for actions triggered
by keybindings, so reflect this by a more generic name.


(In reply to comment #5)
> This is probably a symptom that ShellKeyBindingMode has outperformed its
> expectatives though, maybe should be better renamed to ShellActionMode in the
> future?

Yeah, probably - the type is shared (via a copy-pasted header) with g-s-d though, so I'd rather not rename this on 3-14 ...
Comment 7 Florian Müllner 2014-12-11 15:57:50 UTC
Created attachment 292541 [details] [review]
gestures: Restrict actions based on keybindingMode

(In reply to comment #5)
> too bad even that there's no common gesture JS subclass so this applies to all :(.

It would certainly be possible to change that, though I'm not sure it's really worth it - the check is in gesture_prepare() and no subclass chains up to the parent there, so even with a common subclass it wouldn't automagically work.
We should still restrict other gestures though, so here's an (untested) update which does this ...
Comment 8 Florian Müllner 2014-12-11 16:17:48 UTC
Created attachment 292543 [details] [review]
Rename KeyBindingMode to ActionMode

Updated patch on top of attachment 292541 [details] [review]
Comment 9 Florian Müllner 2014-12-13 13:46:28 UTC
*** Bug 741474 has been marked as a duplicate of this bug. ***
Comment 10 Carlos Garnacho 2014-12-18 16:54:15 UTC
Comment on attachment 292541 [details] [review]
gestures: Restrict actions based on keybindingMode

Looks good to me!
Comment 11 Carlos Garnacho 2014-12-18 16:54:38 UTC
(In reply to comment #6)
> Yeah, probably - the type is shared (via a copy-pasted header) with g-s-d
> though, so I'd rather not rename this on 3-14 ...

Yup, I agree. Let's just do this bit coordinately for 3.16
Comment 12 Carlos Garnacho 2014-12-18 16:58:54 UTC
Comment on attachment 292543 [details] [review]
Rename KeyBindingMode to ActionMode

Very thorough, I think you caught all cases :). Refactors like these make me uneasy about possibly overseen ones though, git grep -i "keybindingmode" should be a good indicative here though, and comes out clean.
Comment 13 Florian Müllner 2014-12-18 17:46:19 UTC
(In reply to comment #11)
> Yup, I agree. Let's just do this bit coordinately for 3.16

It doesn't actually require strict coordination, as the DBus communication between g-s-d and g-s uses the numerical values, so the renaming doesn't break anything on its own.


(In reply to comment #12)
> (From update of attachment 292543 [details] [review])
> Refactors like these make me uneasy about possibly overseen ones though

Right, which is why I'd rather not have that on the stable branch :-)

I don't think I missed any case cases in my sed expression (or produced any false positives), but regular expressions ...
Comment 14 Florian Müllner 2014-12-19 12:01:02 UTC
Attachment 292541 [details] pushed as ddeac23 - gestures: Restrict actions based on keybindingMode
Attachment 292543 [details] pushed as e0eebc9 - Rename KeyBindingMode to ActionMode