Skip to content

Commit 7a6857b

Browse files
committed
[GTK4] Fix CTabFolder chevron click GTK-Critical
Error is like: ``` (SWT:339274): Gtk-CRITICAL **: 17:08:42.533: gtk_widget_compute_point: assertion 'GTK_IS_WIDGET (widget)' failed ``` The problem comes from Control.getSurfaceOrigin method relying on fixedHandle (even when there is not one) use eventHandle() in this case. Tested with Snippet165.
1 parent 23df87e commit 7a6857b

File tree

1 file changed

+3
-2
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+3
-2
lines changed

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

Lines changed: 3 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
@@ -6872,7 +6872,8 @@ Point getWindowOrigin () {
68726872
*/
68736873
Point getSurfaceOrigin () {
68746874
double[] originX = new double[1], originY = new double[1];
6875-
boolean success = GTK4.gtk_widget_translate_coordinates(fixedHandle, getShell().shellHandle, 0, 0, originX, originY);
6875+
long widgetHandle = fixedHandle != 0 ? fixedHandle: eventHandle();
6876+
boolean success = GTK4.gtk_widget_translate_coordinates(widgetHandle, getShell().shellHandle, 0, 0, originX, originY);
68766877

68776878
return success ? new Point((int)originX[0], (int)originY[0]) : new Point(0, 0);
68786879
}

0 commit comments

Comments
 (0)