Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 394227 - [GTK+ 3] Eclipse produces run-time error when running on GTK+ 3.0
Summary: [GTK+ 3] Eclipse produces run-time error when running on GTK+ 3.0
Status: RESOLVED WORKSFORME
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Silenio Quarti CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-11-13 16:50 EST by Anatoly Spektor CLA
Modified: 2012-11-15 12:28 EST (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2012-11-13 16:50:17 EST
When I am running  widgets like ControlExample or HelloWorld with Argument: "-DSWT_GTK3=1" it works fine, whereas when I try running Eclipse Application with this argument I am getting  run-time errors and Eclipse Application crashed:

(Eclipse:21440): GLib-GObject-WARNING **: cannot register existing type `GdkDisplayManager'

(Eclipse:21440): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(Eclipse:21440): GLib-GObject-CRITICAL **: g_type_register_static: assertion `parent_type > 0' failed

(Eclipse:21440): GLib-CRITICAL **: g_once_init_leave: assertion `result != 0' failed

(Eclipse:21440): GLib-GObject-CRITICAL **: g_object_new: assertion `G_TYPE_IS_OBJECT (object_type)' failed


Errors are triggered after this line:

Display.CreateDisplay(DeviceData) line 920:

if (!OS.gtk_init_check (new long /*int*/ [] {0}, null)) {


Any help is highly appreciated!
Comment 1 Silenio Quarti CLA 2012-11-13 18:00:06 EST
To run eclipse you need to set the environment variable "SWT_GTK3" instead of the java system property.  This is necessary because the eclipse launcher cannot check java system properties to decide whether it should load GTK2 or GTK3. 

If running that host eclipse, just type this in the command line:

export SWT_GTK3=1
eclipse

When self-hosting a inner Eclipse use the "Environment" tab in the Run Configuration dialog to add the var.
Comment 2 Anatoly Spektor CLA 2012-11-14 13:11:28 EST
(In reply to comment #1)
> To run eclipse you need to set the environment variable "SWT_GTK3" instead
> of the java system property.  This is necessary because the eclipse launcher
> cannot check java system properties to decide whether it should load GTK2 or
> GTK3. 
> 
> If running that host eclipse, just type this in the command line:
> 
> export SWT_GTK3=1
> eclipse
> 
> When self-hosting a inner Eclipse use the "Environment" tab in the Run
> Configuration dialog to add the var.

Thank you for your response Silenio, unfortunately it does not solve the problem:

 When I put Environmental variable and Run from Eclipse it still gives me  same errors, whereas when I do export and run eclipse, it just launches Eclipse on GTK2.
Comment 3 Silenio Quarti CLA 2012-11-14 13:50:59 EST
Which eclipse build are you using? You need at least I20121113-0800.
Comment 4 Anatoly Spektor CLA 2012-11-15 10:27:05 EST
(In reply to comment #3)
> Which eclipse build are you using? You need at least I20121113-0800.

My eclipse build is: M20120914-1800, but I am building SWT myself, and everything except of Eclipse Application is running successfully. I have tried exporting SWT_GTK3, I have tried putting as an Environmental Variable in Run Configuration -DSWT_GTK3=1. ControlExample works fine, whereas Eclipse Application brings this GdkDisplayManager error
Comment 5 Silenio Quarti CLA 2012-11-15 10:42:41 EST
Eclipse will not work unless you have a new 4.3 build (>=I20121113-0800). You need the fix I did for bug#393681.  This fix will not be ported back to 4.2 maintenance builds.

It is possible to run on older builds, but you have to specify the "-noSplash" option when launching eclipse. This can be done in the Run Configuration dialog, Arguments tab, Program Arguments.
Comment 6 Anatoly Spektor CLA 2012-11-15 10:56:12 EST
(In reply to comment #5)
> Eclipse will not work unless you have a new 4.3 build (>=I20121113-0800).
> You need the fix I did for bug#393681.  This fix will not be ported back to
> 4.2 maintenance builds.
> 
> It is possible to run on older builds, but you have to specify the
> "-noSplash" option when launching eclipse. This can be done in the Run
> Configuration dialog, Arguments tab, Program Arguments.

Thanks Silenio "-noSplash" works perfectly!
Comment 7 Silenio Quarti CLA 2012-11-15 12:28:53 EST
Great!