Skip to content

Commit 100fbc6

Browse files
committed
[Gtk4] Fix CTabItem close button Gtk-CRITICAL
Clicking on CTabItem close button causes: ``` (SWT:2017253): Gtk-CRITICAL **: 21:06:02.496: gtk_widget_compute_point: assertion 'GTK_IS_WIDGET (widget)' failed ``` In this case fixedHandle is 0 and eventHandle has to be used like in #2940
1 parent 3ccbe91 commit 100fbc6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1787,7 +1787,8 @@ public Point toDisplay (Point point) {
17871787
*/
17881788
Point getControlOrigin() {
17891789
double[] originX = new double[1], originY = new double[1];
1790-
boolean success = GTK4.gtk_widget_translate_coordinates(fixedHandle, getShell().shellHandle, 0, 0, originX, originY);
1790+
long widgetHandle = fixedHandle != 0 ? fixedHandle: eventHandle();
1791+
boolean success = GTK4.gtk_widget_translate_coordinates(widgetHandle, getShell().shellHandle, 0, 0, originX, originY);
17911792

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

0 commit comments

Comments
 (0)