Skip to content

Commit 94ea672

Browse files
committed
[Gtk] Stop passing widget handle needlessly in Caret
Widget handle is not used at all thus it only creates confusion.
1 parent a492601 commit 94ea672

2 files changed

Lines changed: 8 additions & 8 deletions

File tree

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2025 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -171,18 +171,18 @@ long gtk_commit (long imcontext, long text) {
171171
long gtk_draw (long widget, long cairo) {
172172
if ((state & OBSCURED) != 0) return 0;
173173
long result = super.gtk_draw (widget, cairo);
174-
drawCaretInFocus(widget, cairo);
174+
drawCaretInFocus(cairo);
175175
return result;
176176
}
177177

178178
@Override
179179
void gtk4_draw (long widget, long cairo, Rectangle bounds) {
180180
if ((state & OBSCURED) != 0) return;
181181
super.gtk4_draw (widget, cairo, bounds);
182-
drawCaretInFocus(widget, cairo);
182+
drawCaretInFocus(cairo);
183183
}
184184

185-
void drawCaretInFocus(long widget, long cairo) {
185+
void drawCaretInFocus(long cairo) {
186186
/*
187187
* blink is needed to be checked as gtk_draw() signals sent from other parts of the canvas
188188
* can interfere with the blinking state. This will ensure that we are only draw/redrawing the
@@ -191,12 +191,12 @@ void drawCaretInFocus(long widget, long cairo) {
191191
* Additionally, only draw the caret if it has focus. See bug 528819.
192192
*/
193193
if (caret != null && blink == true && caret.isFocusCaret()) {
194-
drawCaret(widget,cairo);
194+
drawCaret(cairo);
195195
blink = false;
196196
}
197197
}
198198

199-
private void drawCaret(long widget, long cairo) {
199+
private void drawCaret(long cairo) {
200200
if(this.isDisposed()) return;
201201
if (cairo == 0) error(SWT.ERROR_NO_HANDLES);
202202

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*******************************************************************************
2-
* Copyright (c) 2000, 2025 IBM Corporation and others.
2+
* Copyright (c) 2000, 2026 IBM Corporation and others.
33
*
44
* This program and the accompanying materials
55
* are made available under the terms of the Eclipse Public License 2.0
@@ -125,7 +125,7 @@ private void drawInCellEditor(long window) {
125125
long cairo = GDK.gdk_cairo_create(window);
126126
Point pt = display.map(parent, embeddedInto, new Point(0,0));
127127
Cairo.cairo_translate (cairo, pt.x, pt.y);
128-
parent.drawCaretInFocus(parent.handle, cairo);
128+
parent.drawCaretInFocus(cairo);
129129
Cairo.cairo_destroy(cairo);
130130
}
131131

0 commit comments

Comments
 (0)