# HG changeset patch # User bsmith@81767d24-ef19-dc11-ae90-00e081727c95 # Date 1612942163 0 # Node ID 558959a64772b3d3d700db7fc26ccefd763e537d # Parent 047ad6a5cc1d5506f420a849d0cac468d496384b GTK4: Fix thread safety while using dw_main() and fix an status text issue. This makes GTK4 stable when running multithreaded apps like HandyFTP... Also allows the threading test in dwtest to not cause iter errors. diff -r 047ad6a5cc1d -r 558959a64772 gtk4/dw.c --- a/gtk4/dw.c Wed Feb 10 04:21:37 2021 +0000 +++ b/gtk4/dw.c Wed Feb 10 07:29:23 2021 +0000 @@ -1417,7 +1417,11 @@ */ void API dw_main(void) { + pthread_t orig = _dw_thread; + + _dw_thread = pthread_self(); g_main_loop_run(_DWMainLoop); + _dw_thread = orig; } /* @@ -3132,7 +3136,7 @@ g_object_set_data(G_OBJECT(frame), "_dw_label", (gpointer)tmp); if(_DWDefaultFont) dw_window_set_font(tmp, _DWDefaultFont); - DW_FUNCTION_RETURN_THIS(tmp); + DW_FUNCTION_RETURN_THIS(frame); } /*