gestures: Restrict actions 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. https://bugzilla.gnome.org/show_bug.cgi?id=740237
This commit is contained in:
@ -478,7 +478,9 @@ const WorkspaceSwitchAction = new Lang.Class({
|
||||
},
|
||||
|
||||
vfunc_gesture_prepare : function(action, actor) {
|
||||
return this.get_n_current_points() == this.get_n_touch_points();
|
||||
let allowedModes = Shell.KeyBindingMode.NORMAL | Shell.KeyBindingMode.OVERVIEW;
|
||||
return this.get_n_current_points() == this.get_n_touch_points() &&
|
||||
(allowedModes & Main.keybindingMode);
|
||||
},
|
||||
|
||||
vfunc_gesture_end : function(action, actor) {
|
||||
@ -526,7 +528,7 @@ const AppSwitchAction = new Lang.Class({
|
||||
},
|
||||
|
||||
vfunc_gesture_prepare : function(action, actor) {
|
||||
if (Main.overview.visible) {
|
||||
if (Main.keybindingMode != Shell.KeyBindingMode.NORMAL) {
|
||||
this.cancel();
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user