Skip to content

Commit 12ac449

Browse files
committed
[GTK4] Do not mix gtk 3 and 4 focus event handlers
In #2582 I've mixed the handlers. This fixes it to not call into each other.
1 parent 648bb97 commit 12ac449

File tree

1 file changed

+9
-8
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+9
-8
lines changed

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

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -260,14 +260,15 @@ long gtk_focus_out_event (long widget, long event) {
260260
}
261261

262262
@Override
263-
void gtk4_focus_window_event(long handle, long event) {
264-
if(event == SWT.FocusIn) {
265-
gtk_focus_in_event (handle, event);
266-
if (caret != null) caret.setFocus ();
267-
} else {
268-
gtk_focus_out_event(handle, event);
269-
if (caret != null) caret.killFocus();
270-
}
263+
void gtk4_focus_enter_event(long handle, long event) {
264+
super.gtk4_focus_enter_event (handle, event);
265+
if (caret != null) caret.setFocus ();
266+
}
267+
268+
@Override
269+
void gtk4_focus_leave_event(long handle, long event) {
270+
super.gtk4_focus_leave_event (handle, event);
271+
if (caret != null) caret.setFocus ();
271272
}
272273

273274
@Override

0 commit comments

Comments
 (0)