Re: [java-gnome-hackers] CustomEvent handling
Brought to you by:
afcowie
From: Andrew C. <an...@op...> - 2005-08-30 06:13:21
|
On Thu, 2005-25-08 at 17:52 -0400, Sami Wagiaalla wrote: > A while back I asked about a bug where CustomEvents added where not > getting handled unless a mouse is continuously moving over the window. > ... > Since these function calls where already there but commented out, I > guess there is a good reason why they cannot be used. I applied sami's patch and worked through a bunch of examples I had 1) Sami's test case passes... 2) My two applications that hit this bug now had their progress bars increasing... BUT all three *DON'T EXIT*. Sami's just runs forever, which is probably why he didn't notice. But my two both hang, very hard, when Gtk.mainQuit() gets called. Hung so hard that Ctrl-C to parent terminal / red button in Eclipse were not sufficient to kill them off. > However, the > libgtk-java jni code has a few calls to fucntions that are only valid > when g threads are initialized such as gdk_threads_enter(). Which I believe to be correct, having poked through the GTK API docs. So, my guess is either a) we should NOT be using the gdk threads at all, or b) we should be using them (ie, uncommenting the two lines that sami found is correct) but that we're missing something somewhere else. I thought atexit(gdk_threads_enter) On line 42 of src/jni/org_gnu_gtk_Gtk.c might point in the right direction, and then I suddenly got the inspiration to try the worker thread example program I have (built to native) in gdb, as it at least gave an abort and back to command line as opposed to JVMs just freezing up. I ran that program in GDB, and got: #0 0xb761a557 in _Jv_JNI_Init() () from /usr/lib/libgcj.so.5 #1 0xb761ac45 in _Jv_JNI_PopSystemFrame () from /usr/lib/libgcj.so.5 #2 0xb6828b17 in jg_gobject_destroy () from /home/andrew/workspace/libgtk-java/libgtkjni-2.6.so #3 0xb6734bc2 in g_datalist_clear () from /usr/lib/libglib-2.0.so.0 #4 0xb62c89e0 in g_object_interface_list_properties () from /usr/lib/libgobject-2.0.so.0 #5 0xb657890c in gtk_object_sink () from /usr/lib/libgtk-x11-2.0.so.0 #6 0xb6658bc5 in gtk_widget_set_uposition () from /usr/lib/libgtk-x11-2.0.so.0 #7 0xb654481b in gtk_label_set_attributes () from /usr/lib/libgtk-x11-2.0.so.0 #8 0xb62cad51 in g_object_unref () from /usr/lib/libgobject-2.0.so.0 #9 0xb62ccc3f in g_object_run_dispose () from /usr/lib/libgobject-2.0.so.0 #10 0xb65785c8 in gtk_object_destroy () from /usr/lib/libgtk-x11-2.0.so.0 #11 0xb6652951 in gtk_widget_destroy () from /usr/lib/libgtk-x11-2.0.so.0 #12 0xb6484bdd in gtk_box_reorder_child () from /usr/lib/libgtk-x11-2.0.so.0 #13 0xb64c2add in gtk_container_foreach () from /usr/lib/libgtk-x11-2.0.so.0 #14 0xb64c4cae in gtk_container_unset_focus_chain () from /usr/lib/libgtk-x11-2.0.so.0 #15 0xb62dd1f8 in g_cclosure_marshal_VOID__VOID () from /usr/lib/libgobject-2.0.so.0 #16 0xb62c6d69 in g_cclosure_new_swap () from /usr/lib/libgobject-2.0.so.0 #17 0xb62c6a2b in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0 #18 0xb62db9ac in g_signal_has_handler_pending () from /usr/lib/libgobject-2.0.so.0 #19 0xb62dcb1a in g_signal_emit_valist () from /usr/lib/libgobject-2.0.so.0 [that's libgtk-java-2.6-CVS against a gcj-3.4, although this machine is now running gtk+ 2.8, per my blog post] What we need is someone who really understands Glib and GDK and GTK internals to have a poke at this. I can send a link to my worker example code if people need it. I was all set to release (unofficially or otherwise) a libgtk-java 2.6.3, but we should really figure this out first. AfC Sydney |