From: Thomas Debesse Date: Sun, 21 Mar 2021 18:28:31 +0000 (+0100) Subject: macos: process the texture browser redraw as soon as possible when workarounding... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=917037aaad6866d48ef9dcce1bb7b35e66a1ab93;p=xonotic%2Fnetradiant.git macos: process the texture browser redraw as soon as possible when workarounding the not-working hide --- 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