Skip to content

Commit 84e6db7

Browse files
committed
[Gtk4] Skip double draw in Canvas
Canvas does only custom draw thus fixedHandle receives unwanted snapshot calls leading to double redraws causing caret to become invisible. Fixes #2812
1 parent 7fd3fd6 commit 84e6db7

File tree

1 file changed

+10
-0
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+10
-0
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Canvas.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,4 +546,14 @@ void updateCaret () {
546546
GTK.gtk_im_context_set_cursor_location (imHandle, rect);
547547
}
548548

549+
@Override
550+
void snapshotToDraw(long handle, long snapshot) {
551+
// Skip drawing if this is being called on fixedHandle to prevent double draws
552+
// making carret not visible at all
553+
if (fixedHandle != 0 && handle == fixedHandle) {
554+
return;
555+
}
556+
super.snapshotToDraw(handle, snapshot);
557+
}
558+
549559
}

0 commit comments

Comments
 (0)