<AWT Dev> Bug 6913179, FileDialog uses native GTK under Linux: first patch
Costantino Cerbo
c.cerbo at gmail.com
Sun Jan 17 14:14:46 PST 2010
Hello,
this is a first version of my patch for the issue 6913179: The
java.awt.FileDialog should use native GTK file chooser on linux
distros.
There are still some problems:
1) The FileDialog isn't disposed. I cannot understand why, because in
'sun_awt_X11_GtkFileDialogPeer.c#handle_response' I call:
fp_gtk_widget_hide(dialog);
fp_gtk_widget_destroy(dialog);
fp_gtk_main_quit();
2) The shortcut "Search" on the left up side is missing because we
should initialize the thread system in GLib by calling:
if (!g_thread_supported ()) {
g_thread_init (NULL);
}
but I wasn't able to find a way to dynamically load these functions
(they are linked with gthread-2.0).
Apart these two issues, the new GtkFileDialog should be already usable
and I'm looking forward to receiving your feedback.
Could you please (or somebody else at Sun) help me to solve these
remaining problems? I spent the last two nights without success: my
knowledge of C and GTK is quite limited and alone I'll never succeed.
Last but not least, I've some problems with the incremental make.
When I make a full build, the output goes to
~/openjdk/jdk7/mytl/build/linux-i586
while with and incremental make in a subfolder, the result is in
~/openjdk/jdk7/mytl/jdk/build/linux-i586
When a run a class using the first location (output of full build)
it'all right, but in the second case I get this exception:
/home/c.cerbo/openjdk/jdk7/mytl/jdk/build/linux-i586/bin/java -cp bin
sun.awt.X11.FileDialogTest
Exception in thread "main" java.util.ServiceConfigurationError:
sun.java2d.pipe.RenderingEngine: Provider
sun.java2d.pisces.PiscesRenderingEngine not found
at java.util.ServiceLoader.fail(ServiceLoader.java:231)
at java.util.ServiceLoader.access$400(ServiceLoader.java:181)
at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:367)
at java.util.ServiceLoader$1.next(ServiceLoader.java:438)
at sun.java2d.pipe.RenderingEngine$1.run(RenderingEngine.java:144)
at java.security.AccessController.doPrivileged(Native Method)
at sun.java2d.pipe.RenderingEngine.getInstance(RenderingEngine.java:120)
at sun.java2d.pipe.LoopPipe.<clinit>(LoopPipe.java:52)
at sun.java2d.SurfaceData.<clinit>(SurfaceData.java:400)
at sun.awt.X11GraphicsConfig.<clinit>(X11GraphicsConfig.java:79)
at sun.awt.X11GraphicsDevice.makeDefaultConfiguration(X11GraphicsDevice.java:244)
at sun.awt.X11GraphicsDevice.getDefaultConfiguration(X11GraphicsDevice.java:214)
at java.awt.Window.initGC(Window.java:466)
at java.awt.Window.init(Window.java:486)
at java.awt.Window.<init>(Window.java:437)
at java.awt.Window.<init>(Window.java:591)
at java.awt.Dialog.<init>(Dialog.java:664)
at java.awt.Dialog.<init>(Dialog.java:408)
at java.awt.FileDialog.<init>(FileDialog.java:177)
at java.awt.FileDialog.<init>(FileDialog.java:141)
at sun.awt.X11.FileDialogTest.main(FileDialogTest.java:9)
Sometimes I have also to change the permissions:
/bin/cp: cannot create regular file
`../../../build/linux-i586/tmp/modules/awt/lib/fontconfig.bfc':
Permission denied
make: *** [../../../build/linux-i586/lib/fontconfig.bfc] Error 1
That means that I have to make each time a full build, and you can
imagine how time consuming is this!
Thanks in advance for your collaboration,
Costantino
-------------- next part --------------
A non-text attachment was scrubbed...
Name: b6913179.patch
Type: application/octet-stream
Size: 17082 bytes
Desc: not available
Url : http://mail.openjdk.java.net/pipermail/awt-dev/attachments/20100117/0e822482/b6913179.patch
More information about the awt-dev
mailing list