From: Thomas Debesse Date: Tue, 21 Jun 2022 03:30:11 +0000 (+0200) Subject: contrib: fix bobToolz loading X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=ae7358fd50ac6cc3b2a6e4bd6e386cf13df7fbb4;p=xonotic%2Fnetradiant.git contrib: fix bobToolz loading --- diff --git a/contrib/bobtoolz/CMakeLists.txt b/contrib/bobtoolz/CMakeLists.txt index c9b83cb7..3425a1df 100644 --- a/contrib/bobtoolz/CMakeLists.txt +++ b/contrib/bobtoolz/CMakeLists.txt @@ -2,7 +2,7 @@ radiant_plugin(bobtoolz dialogs/dialogs-gtk.cpp dialogs/dialogs-gtk.h bobToolz.h - bobToolz-GTK.cpp + bobToolz-GTK.cpp bobToolz-GTK.h bsploader.cpp bsploader.h cportals.cpp CPortals.h ctfresource_gtk.h diff --git a/contrib/bobtoolz/bobToolz-GTK.h b/contrib/bobtoolz/bobToolz-GTK.h index e7dcce25..5e6b3d96 100644 --- a/contrib/bobtoolz/bobToolz-GTK.h +++ b/contrib/bobtoolz/bobToolz-GTK.h @@ -3,6 +3,6 @@ #include -extern ui::Widget g_pRadiantWnd; +static ui::Window main_window{ui::null}; #endif diff --git a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp index be0e4add..cfbf12c4 100644 --- a/contrib/bobtoolz/dialogs/dialogs-gtk.cpp +++ b/contrib/bobtoolz/dialogs/dialogs-gtk.cpp @@ -213,7 +213,7 @@ EMessageBoxReturn DoMessageBox( const char* lpText, const char* lpCaption, EMess int loop = 1; auto window = ui::Window( ui::window_type::TOP ); - gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); + gtk_window_set_transient_for( GTK_WINDOW( window ), main_window ); window.connect( "delete_event", G_CALLBACK( custom_dialog_delete_callback ), NULL ); window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); gtk_window_set_title( window, lpCaption ); @@ -408,7 +408,7 @@ EMessageBoxReturn DoPolygonBox( PolygonRS* rs ){ int loop = 1; auto window = ui::Window( ui::window_type::TOP ); - gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); + gtk_window_set_transient_for( GTK_WINDOW( window ), main_window ); window.connect( "delete_event", G_CALLBACK( custom_dialog_delete_callback ), NULL ); window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL ); @@ -1278,7 +1278,7 @@ EMessageBoxReturn DoResetTextureBox( ResetTextureRS* rs, ui::Window main_window int loop = 1; auto window = main_window.create_dialog_window( "Texture Reset", G_CALLBACK( custom_dialog_delete_callback ), &dialog ); - gtk_window_set_transient_for( GTK_WINDOW( window ), GTK_WINDOW( g_pRadiantWnd ) ); + gtk_window_set_transient_for( GTK_WINDOW( window ), main_window ); gtk_window_set_modal( GTK_WINDOW( window ), TRUE ); window.connect( "destroy", G_CALLBACK( gtk_widget_destroy ), NULL );