macos: process the texture browser redraw as soon as possible when workarounding...
authorThomas Debesse <dev@illwieckz.net>
Sun, 21 Mar 2021 18:28:31 +0000 (19:28 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sun, 21 Mar 2021 19:44:18 +0000 (20:44 +0100)
radiant/texwindow.cpp

index dda6fb77de232fb19ce365dded33920b113c6896..f741f0ceafafa77bff560b1177843f26b02bdf0f 100644 (file)
@@ -2400,6 +2400,7 @@ void TextureBrowser_showGLWidget(){
                textureBrowser.m_vframe.set_child_packing( textureBrowser.m_hframe, TRUE, TRUE, 0, ui::Packing::START );
                textureBrowser.m_vframe.set_child_packing( textureBrowser.m_hfiller, FALSE, FALSE, 0, ui::Packing::START );
                textureBrowser.m_vframe.set_child_packing( textureBrowser.m_gl_widget, TRUE, TRUE, 0, ui::Packing::START );
+
                textureBrowser.m_gl_widget.show();
        }
 }
@@ -2412,10 +2413,14 @@ void TextureBrowser_hideGLWidget(){
                textureBrowser.m_vframe.set_child_packing( textureBrowser.m_hframe, FALSE, FALSE, 0, ui::Packing::END );
                textureBrowser.m_vframe.set_child_packing( textureBrowser.m_hfiller, TRUE, TRUE, 0, ui::Packing::START);
                textureBrowser.m_vframe.set_child_packing( textureBrowser.m_gl_widget, FALSE, FALSE, 0, ui::Packing::END );
-               TextureBrowser_redraw( &GlobalTextureBrowser() );
+
                // The hack needs the GL widget to not be hidden to work,
                // so resizing it triggers the redraw of it with the new size.
                // GlobalTextureBrowser().m_gl_widget.hide();
+
+               // Trigger the redraw.
+               TextureBrowser_redraw( &GlobalTextureBrowser() );
+               ui::process();
        }
 }
 #endif // WORKAROUND_MACOS_GTK2_GLWIDGET