From: Thomas Debesse Date: Sat, 23 Feb 2019 21:43:22 +0000 (+0100) Subject: Garux: disable gtk workaround X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=a8178e93a1cc69a43ee4c3c2318a425df5951885;p=xonotic%2Fnetradiant.git Garux: disable gtk workaround --- diff --git a/libs/gtkutil/widget.h b/libs/gtkutil/widget.h index d001fd70..ff93211d 100644 --- a/libs/gtkutil/widget.h +++ b/libs/gtkutil/widget.h @@ -30,6 +30,8 @@ #include "debugging/debugging.h" #include "property.h" +#define GARUX_GTK_WORKAROUND +#ifndef GARUX_GTK_WORKAROUND inline bool widget_is_visible( GtkWidget* widget ){ return GTK_WIDGET_VISIBLE( widget ) != FALSE; } @@ -51,6 +53,7 @@ inline void widget_set_visible( GtkWidget* widget, bool show ){ gtk_widget_hide( widget ); } } +#endif class ToggleItem { Callback &)> m_exportCallback; diff --git a/libs/gtkutil/window.cpp b/libs/gtkutil/window.cpp index eee5b582..c1613500 100644 --- a/libs/gtkutil/window.cpp +++ b/libs/gtkutil/window.cpp @@ -29,12 +29,15 @@ inline void CHECK_RESTORE( ui::Widget w ){ if ( gpointer_to_int( g_object_get_data( G_OBJECT( w ), "was_mapped" ) ) != 0 ) { w.show(); +#define GARUX_GTK_WORKAROUND +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after min/restore */ GtkWidget* glwidget = GTK_WIDGET( g_object_get_data( G_OBJECT( w ), "glwidget" ) ); if ( glwidget ){ gtk_widget_hide( glwidget ); gtk_widget_show( glwidget ); } +#endif } } diff --git a/radiant/groupdialog.cpp b/radiant/groupdialog.cpp index 22c6150a..ad64793f 100644 --- a/radiant/groupdialog.cpp +++ b/radiant/groupdialog.cpp @@ -57,6 +57,8 @@ void Create( ui::Window parent ); void Show(){ // workaround for strange gtk behaviour - modifying the contents of a window while it is not visible causes the window position to change without sending a configure_event m_position_tracker.sync( m_window ); +#define GARUX_GTK_WORKAROUND +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ GtkWidget* glwidget = GTK_WIDGET( g_object_get_data( G_OBJECT( m_window ), "glwidget" ) ); if ( glwidget ){ @@ -65,6 +67,7 @@ void Show(){ gtk_widget_hide( glwidget ); gtk_widget_show( glwidget ); } +#endif m_window.show(); } void Hide(){ diff --git a/radiant/mainframe.cpp b/radiant/mainframe.cpp index c8078621..a4429fc1 100644 --- a/radiant/mainframe.cpp +++ b/radiant/mainframe.cpp @@ -3061,8 +3061,11 @@ void MainFrame::Create(){ window.add(frame); } CamWnd_setParent( *m_pCamWnd, window ); +#define GARUX_GTK_WORKAROUND +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ g_object_set_data( G_OBJECT( window ), "glwidget", CamWnd_getWidget( *m_pCamWnd ) ); +#endif g_floating_windows.push_back( window ); } @@ -3082,8 +3085,10 @@ void MainFrame::Create(){ window.add(frame); } XY_Top_Shown_Construct( window ); +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ g_object_set_data( G_OBJECT( window ), "glwidget", m_pXYWnd->GetWidget() ); +#endif g_floating_windows.push_back( window ); } @@ -3103,8 +3108,10 @@ void MainFrame::Create(){ } XZ_Front_Shown_Construct( window ); +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ g_object_set_data( G_OBJECT( window ), "glwidget", m_pXZWnd->GetWidget() ); +#endif g_floating_windows.push_back( window ); } @@ -3124,8 +3131,10 @@ void MainFrame::Create(){ } YZ_Side_Shown_Construct( window ); +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ g_object_set_data( G_OBJECT( window ), "glwidget", m_pYZWnd->GetWidget() ); +#endif g_floating_windows.push_back( window ); } @@ -3133,8 +3142,10 @@ void MainFrame::Create(){ { auto frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) ); g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() ); +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() ); +#endif } @@ -3169,8 +3180,10 @@ void MainFrame::Create(){ { auto frame = create_framed_widget( TextureBrowser_constructWindow( window ) ); g_page_textures = GroupDialog_addPage( "Textures", frame, TextureBrowserExportTitleCaller() ); +#ifndef GARUX_GTK_WORKAROUND /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */ g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() ); +#endif } }