windowPreview: Unset selected if window was clicked to switch workspaces

This is used to detect whether a click was short enough to select a
window and activate it or long enough to start a drag. Usually when
clicking on a window and selecting it, this leaves the overview, but
when clicking on a window on a neighboring workspace, the overview is
kept open, but selected is not unset in this case. So all attempts at
dragging the window after using it to switch workspaces will fail.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/3783

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1717>
This commit is contained in:
Sebastian Keller 2021-02-24 23:22:52 +01:00 committed by Marge Bot
parent 6390265ba1
commit a6588d054f

View File

@ -819,8 +819,10 @@ var WindowPreview = GObject.registerClass({
// run - make sure to not start a drag in that case // run - make sure to not start a drag in that case
this._longPressLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => { this._longPressLater = Meta.later_add(Meta.LaterType.BEFORE_REDRAW, () => {
delete this._longPressLater; delete this._longPressLater;
if (this._selected) if (this._selected) {
this._selected = false;
return; return;
}
let [x, y] = action.get_coords(); let [x, y] = action.get_coords();
action.release(); action.release();
this._draggable.startDrag(x, y, global.get_current_time(), this._dragTouchSequence, event.get_device()); this._draggable.startDrag(x, y, global.get_current_time(), this._dragTouchSequence, event.get_device());