From 739ae270bba0ecbc0b5f342508ea39ded6cdc3e1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BB=D0=B5=D0=BA=D1=81=D0=B0=D0=BD=D0=B4=D1=8A?= =?UTF-8?q?=D1=80=20=D0=9A=D1=83=D1=80=D1=82=D0=B0=D0=BA=D0=BE=D0=B2?= Date: Wed, 7 Jan 2026 17:12:33 +0200 Subject: [PATCH] [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. --- .../Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java index 0f3794b2abc..039d65178f5 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Control.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2025 IBM Corporation and others. + * Copyright (c) 2000, 2026 IBM Corporation and others. * * This program and the accompanying materials * are made available under the terms of the Eclipse Public License 2.0 @@ -6872,7 +6872,8 @@ Point getWindowOrigin () { */ Point getSurfaceOrigin () { double[] originX = new double[1], originY = new double[1]; - boolean success = GTK4.gtk_widget_translate_coordinates(fixedHandle, getShell().shellHandle, 0, 0, originX, originY); + long widgetHandle = fixedHandle != 0 ? fixedHandle: eventHandle(); + boolean success = GTK4.gtk_widget_translate_coordinates(widgetHandle, getShell().shellHandle, 0, 0, originX, originY); return success ? new Point((int)originX[0], (int)originY[0]) : new Point(0, 0); }