]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Garux: disable gtk workaround
authorThomas Debesse <dev@illwieckz.net>
Sat, 23 Feb 2019 21:43:22 +0000 (22:43 +0100)
committerThomas Debesse <dev@illwieckz.net>
Sun, 24 Feb 2019 00:32:46 +0000 (01:32 +0100)
libs/gtkutil/widget.h
libs/gtkutil/window.cpp
radiant/groupdialog.cpp
radiant/mainframe.cpp

index d001fd702588d5c1fd94b509a7274ab9c366cb82..ff93211dc632e46e85983530be09c7f13b4d98ba 100644 (file)
@@ -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<void(const Callback<void(bool)> &)> m_exportCallback;
index eee5b58202519fb0147a8877881d24566e6a120e..c1613500d12298de8664e83fe286787ab21de039 100644 (file)
 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
        }
 }
 
index 22c6150ae848933b2fa08319ef44a8122b4e43e3..ad64793f6ef4e34ab423bfcc9b6afdb6e877efbe 100644 (file)
@@ -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(){
index c8078621f3a97f79e889d45c0e82f699c623c3aa..a4429fc11ddc0f7131ab942926ebe231ddfcafc6 100644 (file)
@@ -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
                }
        }