Threading issues

I'm using threads with GTK+ for the first time and having trouble. The only time I start a new thread is for the (noticeably slow) file save and open routines.

When the user selects File -> Save the event handler disables the main window and starts a new thread. The entry point of that thread saves the file and then enables the main window again.

The save routine (running in the new thread) shows dialog boxes, both modal and modaless, but both transient on the main window. Is this simply not allowed?

The first dialog shown by the save thread is the file selector. The file selector shows ok, but when I close it I get

(cspassword:15291): Gdk-CRITICAL **: file gdkwindow-x11.c: line 1908 (gdk_window_set_geometry_hints): assertion `window != NULL' failed

(cspassword:15291): Gdk-CRITICAL **: file gdkwindow-x11.c: line 1289 (gdk_window_resize): assertion `window != NULL' failed
Xlib: unexpected async reply (sequence 0x5e7)!

The program is otherwise stable and the whole thing works when I keep the save routine in the main thread (running from the event handler). I don't think there could be any problems with critical sections here; with the main window disabled there is no way that the document would be modified during the save routine.


Chris Seaton

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