Skip to content

Commit 018a151

Browse files
author
Benjamin Pasero
committed
Tabs: dragging tabs around causes the cursor to flicker a lot (fixes microsoft#38753)
1 parent a858ad5 commit 018a151

2 files changed

Lines changed: 9 additions & 0 deletions

File tree

src/vs/workbench/browser/parts/editor/media/tabstitle.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@
5151
will-change: transform; /* forces tab to be drawn on a separate layer (fixes https://github.com/Microsoft/vscode/issues/18733) */
5252
}
5353

54+
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.dragged-over * {
55+
pointer-events: none; /* prevents cursor flickering (fixes https://github.com/Microsoft/vscode/issues/38753) */
56+
}
57+
5458
.monaco-workbench > .part.editor > .content > .one-editor-silo > .container > .title .tabs-container > .tab.close-button-left {
5559
flex-direction: row-reverse;
5660
padding-left: 0;

src/vs/workbench/browser/parts/editor/tabsTitleControl.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -773,6 +773,8 @@ export class TabsTitleControl extends TitleControl {
773773
}
774774
}
775775

776+
DOM.addClass(tab, 'dragged-over');
777+
776778
if (!draggedEditorIsTab) {
777779
this.updateDropFeedback(tab, true, index);
778780
}
@@ -782,13 +784,15 @@ export class TabsTitleControl extends TitleControl {
782784
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_LEAVE, (e: DragEvent) => {
783785
counter--;
784786
if (counter === 0) {
787+
DOM.removeClass(tab, 'dragged-over');
785788
this.updateDropFeedback(tab, false, index);
786789
}
787790
}));
788791

789792
// Drag end
790793
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DRAG_END, (e: DragEvent) => {
791794
counter = 0;
795+
DOM.removeClass(tab, 'dragged-over');
792796
this.updateDropFeedback(tab, false, index);
793797

794798
this.onEditorDragEnd();
@@ -797,6 +801,7 @@ export class TabsTitleControl extends TitleControl {
797801
// Drop
798802
disposables.push(DOM.addDisposableListener(tab, DOM.EventType.DROP, (e: DragEvent) => {
799803
counter = 0;
804+
DOM.removeClass(tab, 'dragged-over');
800805
this.updateDropFeedback(tab, false, index);
801806

802807
const { group, position } = this.toTabContext(index);

0 commit comments

Comments
 (0)