After releasing the last version of my program[1] a user reported a
strange bug caused by the interruption of the GTK main loop.

Basically, my program provides an Assistant so the user is guided to
split or merge files. In the last page of the assistant, when confirming
the split/merge the main window is refreshed with some new data and a
thread is started to proceed to the requested action. The tricky point
is that the window *must* be fully refreshed before the thread starts.

So when the interface is not fully refreshed an error message is
displayed and the action is canceled. The origin of the bug I had was
just this. The thread interrupted and started before the GTK main loop
finish the refresh of the UI. It is invisible to the user because all of
this occurs pretty quickly.

I finally found a fix for that using 2 recently exposed methods:
  - Gtk.eventsPending()
  - Gtk.mainIterationDo()

You can take a look at the fix by following this link:
  - http://trac.gnome-split.org/changeset/265
or by grabbing the code.

This fix forces the GTK main loop to run until there is no more things
to proceed.

What do you think about this fix?

--

Guillaume Mazoyer

Attachment: signature.asc
Description: Digital signature

------------------------------------------------------------------------------
Special Offer -- Download ArcSight Logger for FREE!
Finally, a world-class log management solution at an even better 
price-free! And you'll get a free "Love Thy Logs" t-shirt when you
download Logger. Secure your free ArcSight Logger TODAY!
http://p.sf.net/sfu/arcsisghtdev2dev
_______________________________________________
java-gnome-developer mailing list
java-gnome-developer@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/java-gnome-developer

Reply via email to