<AWT Dev> Bug 6913179, FileDialog uses native GTK under Linux: first patch

Costantino Cerbo c.cerbo at gmail.com
Mon Feb 15 11:05:01 PST 2010

Hi Damjan,

2010/2/12 Damjan Jovanovic <damjan.jov at gmail.com>:
> My patch for all these changes is based on your latest one and include
> Peter's (hackish?) patch. It's attached.

Thanks for the great job! The FileDialog works now also with the GTK
L&F and without blocking the EDT.
As you said, the key was the invocation of fp_gdk_threads_enter() and

> Otherwise, your patch lacks error checking (eg. in calls to
> GetJavaVM() and NewStringUTF()), has typos in comments, and relies on
> C99 features like C++ style comments and variable declarations in the
> middle of a code block (do we allow those in Java?). In
> sun_awt_X11_GtkFileDialogPeer.c you name the function "quit" and
> document it as "hide"; similarly for "show" and "run". I am not
> convinced I got all the GTK calls to be thread safe, so please audit
> the code very carefully, and my locking could be a bit too fine
> grained and impact the GTK LAF drawing performance.
About these points I think that Peter and Anthony may direct take care
of them, without that I release a new patch.
I've checked swing_GTKEngine.c and swing_GTKStyle.c and the calls to
fp_gdk_threads_enter() and fp_gdk_threads_leave() are overall.


More information about the awt-dev mailing list