eclipse-platform / eclipse.platform.swt

Eclipse SWT
https://www.eclipse.org/swt/
Eclipse Public License 2.0
118 stars 139 forks source link

SWT_GTK4=1 -> Eclipse start hangs in splash #1628

Open vogella opened 3 days ago

vogella commented 3 days ago

According to @laeubi announcement, todays build should support GTK4

Tried if with SWT_GTK4=1 on latest Ubuntu and get hanging splash screen.

image

Log:

(java:40344): GLib-GObject-CRITICAL **: 07:03:49.805: cannot register existing type 'GdkEvent'

(java:40344): GLib-CRITICAL **: 07:03:49.805: g_once_init_leave: assertion 'result != 0' failed

(java:40344): GLib-GObject-CRITICAL **: 07:03:49.805: g_type_register_static: assertion 'parent_type > 0' failed

(java:40344): GLib-CRITICAL **: 07:03:49.805: g_once_init_leave: assertion 'result != 0' failed

laeubi commented 3 days ago

@vogella please provide

vogella commented 3 days ago

Eclipse SDK Version: 2025-03 (4.35) Build id: I20241127-1800 OS: Linux, v.6.8.0-49-generic, x86_64 / gtk 3.24.41 Java vendor: Ubuntu Java runtime version: 21.0.5+11-Ubuntu-1ubuntu124.04 Java version: 21.0.5

tomaswolf commented 3 days ago

Hm; this says gtk 3.24.41...

akurtakov commented 3 days ago

@vogella Please note that SWT has been compiled with gtk 4 support but launcher isn't and this is most likely what fails for you. Use the launcher.jar and not executable for now (to uncover pending SWT problems).

vogella commented 2 days ago

Thanks @akurtakov, I interpreted the announcement email in the way that the executable should also work (as it mentioned Eclipse applications). Will retry with the JAR only.

ptziegler commented 2 days ago

You get the same issue with the splash screen when launching the IDE from within the SWT workspace. For whatever reason, SWT gets stuck in the gtk_init() method.

Bypassing the splash screen by either using the jar or -noSplash both work, except that the IDE then crashes while showing the workspace selection screen:

hs_err_pid42410.log

C  [libswt-pi4-gtk-4968r2.so+0x414ca]  Java_org_eclipse_swt_internal_gtk_OS_G_1OBJECT_1TYPE+0x0
j  org.eclipse.swt.accessibility.AccessibleObject.sendEvent(ILjava/lang/Object;)V+1046
j  org.eclipse.swt.accessibility.Accessible.sendEvent(ILjava/lang/Object;)V+17
j  org.eclipse.jface.dialogs.TitleAreaDialog.updateMessage(Ljava/lang/String;)V+46
j  org.eclipse.jface.dialogs.TitleAreaDialog.showMessage(Ljava/lang/String;Lorg/eclipse/swt/graphics/Image;Ljava/lang/String;)V+74
j  org.eclipse.jface.dialogs.TitleAreaDialog.setMessage(Ljava/lang/String;I)V+98
j  org.eclipse.jface.dialogs.TitleAreaDialog.setMessage(Ljava/lang/String;)V+3
j  org.eclipse.ui.internal.ide.ChooseWorkspaceDialog.createDialogArea(Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control;+28
j  org.eclipse.jface.dialogs.TitleAreaDialog.createContents(Lorg/eclipse/swt/widgets/Composite;)Lorg/eclipse/swt/widgets/Control;+128
j  org.eclipse.jface.window.Window.create()V+14
j  org.eclipse.jface.dialogs.Dialog.create()V+1
j  org.eclipse.jface.window.Window.open()I+23

Reason most likely being that the AccessibleObject hasn't been implemented for GTK4, so events are fired using a NULL handle.

https://github.com/eclipse-platform/eclipse.platform.swt/blob/cfa74b494291a25ec1b452ddfbddd92401ec0a43/bundles/org.eclipse.swt/Eclipse%20SWT%20Accessibility/gtk/org/eclipse/swt/accessibility/AccessibleObject.java#L49-L51

laeubi commented 2 days ago

Reason most likely being that the AccessibleObject hasn't been implemented for GTK4, so events are fired using a NULL handle.

@ptziegler do you think you can reproduce the problem in a standalone snippet?

ptziegler commented 2 days ago

@ptziegler do you think you can reproduce the problem in a standalone snippet?

That class isn't really trivial, so I'd first have to understand what exactly it does... but I suppose I can have a look.