Skip to content

Commit

Permalink
Revert "adding shift release listener to drag and drag over events"
Browse files Browse the repository at this point in the history
This reverts commit 4f5d9e8.
  • Loading branch information
swordensen committed Apr 6, 2024
1 parent 44f4fda commit 40bc29c
Showing 1 changed file with 2 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,15 @@ export class WebviewWindowDragMonitor extends Disposable {
constructor(targetWindow: CodeWindow, getWebview: () => IWebview | undefined) {
super();

const onDragStart = () => {
this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_START, () => {
getWebview()?.windowDidDragStart();
};
}));

const onDragEnd = () => {
getWebview()?.windowDidDragEnd();
};

this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_START, () => {
onDragStart();
}));

this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_END, onDragEnd));

this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.MOUSE_MOVE, currentEvent => {
if (currentEvent.buttons === 0) {
onDragEnd();
Expand All @@ -41,18 +36,7 @@ export class WebviewWindowDragMonitor extends Disposable {
this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG, (event) => {
if (event.shiftKey) {
onDragEnd();
} else {
onDragStart();
}
}));

this._register(DOM.addDisposableListener(targetWindow, DOM.EventType.DRAG_OVER, (event) => {
if (event.shiftKey) {
onDragEnd();
} else {
onDragStart();
}
}));

}
}

0 comments on commit 40bc29c

Please sign in to comment.