From 917037aaad6866d48ef9dcce1bb7b35e66a1ab93 Mon Sep 17 00:00:00 2001 From: Thomas Debesse Date: Sun, 21 Mar 2021 19:28:31 +0100 Subject: [PATCH] macos: process the texture browser redraw as soon as possible when workarounding the not-working hide --- radiant/texwindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/radiant/texwindow.cpp b/radiant/texwindow.cpp index dda6fb77..f741f0ce 100644 --- a/radiant/texwindow.cpp +++ b/radiant/texwindow.cpp @@ -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 -- 2.39.2