Re: [gtk-list] Re: Bug in Toggle Button {Was: problem with threads and toggle button]



Damon Chaplin wrote:
> 
> I think the problem is partly caused by GTK+ not passing some GDK events on to
> widgets which are insensitive. (See gtk_propagate_event() in gtk/gtkmain.c)
> 
> So if you are pressing a button, and it is set insensitive from another
> thread, then it won't receive the button release event. So it won't release
> the grab, and it may be in a bit of a weird state internally.
> 
> Is GTK+ supposed to be thread-safe?

At least this is what I have understood from this list. If you do your
gtk stuff in the main thread, then there should be no problem. That
using gdk_thread_enter and its counter part should be enough to have a
threaded application. 

And the problem is not that gtk is not passing gdk events to insensitive
widgets, but that setting insensitive lets the widgets in inconsistent
states. Like the case with the toggle buttons. As I have said, setting
insensitive should be preceded by canceling unfinished actions (like
removing the grab and removing the focus. Eventually call the callbacks
for mouse out and release events).

Ionutz
-- 
Mental backup in progress - Do Not Disturb!
--
http://borco-ei.eng.hokudai.ac.jp/~borco/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]