Mouse click problem using Eclipse Galileo on Linux with GTK (Gnome)
As I recently upgraded my operating system from Ubuntu Linux 9.04 to Ubuntu Linux 9.10, I faced a weird problem using Eclipse Galileo: Most of the times I clicked a dialog’s button, nothing happend. As a programmer, I would have said that Eclipse forgets to handle onclick events
.
Tracking the issue down
My researches led me to a bug. It is documented at Bug 287307 – [Widgets] [GTK2.18] Control.setZOrder broken on Gtk+ >= 2.17.3. Alexander Larsson tracked the issue down. The following analysis fragment was taken from https://bugs.eclipse.org/bugs/show_bug.cgi?id=287307.
In Gtk+ 2.17.3 and onwards (will be the stable 2.18 release eventually) we made GdkWindow able to be non-native (see e.g. http://live.gnome.org/GTK%2B/ClientSideWindows). I got this bug filed about eclipse: http://bugzilla.gnome.org/show_bug.cgi?id=591373 And (I believe) I tracked it down to Control.setZOrder(). This function calls XReconfigureWMWindow() directly on the XWindows from GdkWindow. Now, we do support native GdkWindows mixes with non-native, and if you call gdk_x11_drawable_get_xid() we will on-demand convert the window to native. However, if you change the stacking order (or in general the window hierarchy) behind gdks back things will start going bad, because we use knowledge of this to determine the clipping regions for windows.
Quickfixing the issue
As a quick fix, he placed an environment variable hack in GNOME GIT source code repository.
Applying the quickfix
To use Alexander Larsson’s quickfix, you have to place an environment variable before starting Eclipse. This variable is called GDK_NATIVE_WINDOWS. It requires the value 1. In my special case, I start Eclipse by using the following.
env GDK_NATIVE_WINDOWS=1 /opt/eclipse_galileo_jee/eclipse --clean
References and resources
- Bug 287307 – [Widgets] [GTK2.18] Control.setZOrder broken on Gtk+ >= 2.17.3
- GNOME GIT source code repository
