From abc43530bcb17f22e4a653f71ec44efa63731af2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Dre=C3=9Fler?= Date: Thu, 17 Mar 2022 21:27:28 +0100 Subject: [PATCH] dnd: Remove buttonDown private property This was introduced with commit 6cae94edcc23cbbb509c3a02833b132c6e0aa74f, it doesn't seem to make sense anymore these days. Part-of: --- js/ui/dnd.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/js/ui/dnd.js b/js/ui/dnd.js index 63ce5a020..4ba724d1f 100644 --- a/js/ui/dnd.js +++ b/js/ui/dnd.js @@ -115,7 +115,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { this._dragActorOpacity = params.dragActorOpacity; this._dragTimeoutThreshold = params.timeoutThreshold; - this._buttonDown = false; // The mouse button has been pressed and has not yet been released. this._animationInProgress = false; // The drag is over and the item is in the process of animating to its original position (snapping back or reverting). this._dragCancellable = true; } @@ -124,7 +123,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { if (event.get_button() != 1) return Clutter.EVENT_PROPAGATE; - this._buttonDown = true; this._grabActor(event.get_device()); let [stageX, stageY] = event.get_coords(); @@ -151,7 +149,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { !global.display.is_pointer_emulating_sequence(event.get_event_sequence())) return Clutter.EVENT_PROPAGATE; - this._buttonDown = true; this._grabActor(event.get_device(), event.get_event_sequence()); this._dragStartTime = event.get_time(); this._dragThresholdIgnored = false; @@ -243,7 +240,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { // to complete the drag and ensure that whatever happens to be under the pointer does // not get triggered if the drag was cancelled with Esc. if (this._eventIsRelease(event)) { - this._buttonDown = false; if (this._dragState == DragState.DRAGGING) { return this._dragActorDropped(event); } else if ((this._dragActor != null || this._dragState == DragState.CANCELLED) && @@ -288,7 +284,6 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { * PopupMenu.ignoreRelease()) */ fakeRelease() { - this._buttonDown = false; this._ungrabActor(); } @@ -703,8 +698,7 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { if (this._actorDestroyed || wasCancelled) { global.display.set_cursor(Meta.Cursor.DEFAULT); - if (!this._buttonDown) - this._dragComplete(); + this._dragComplete(); this.emit('drag-end', eventTime, false); if (!this._dragOrigParent && this._dragActor) this._dragActor.destroy(); @@ -755,8 +749,7 @@ var _Draggable = class _Draggable extends Signals.EventEmitter { return; this._animationInProgress = false; - if (!this._buttonDown) - this._dragComplete(); + this._dragComplete(); global.display.set_cursor(Meta.Cursor.DEFAULT); }