inline void widget_set_visible( GtkWidget* widget, bool shown ){
if ( shown ) {
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ GtkWidget* glwidget = GTK_WIDGET( g_object_get_data( G_OBJECT( widget ), "glwidget" ) );
+ if ( glwidget ){
+ //if ( widget_is_visible( glwidget ) )
+ //globalOutputStream() << "glwidget have been already visible :0\n"; /* is not hidden aswell, according to this */
+ gtk_widget_hide( glwidget );
+ gtk_widget_show( glwidget );
+ }
gtk_widget_show( widget );
}
else
inline void CHECK_RESTORE( GtkWidget* w ){
if ( gpointer_to_int( g_object_get_data( G_OBJECT( w ), "was_mapped" ) ) != 0 ) {
gtk_widget_show( w );
+ /* 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 );
+ }
}
}
inline void CHECK_MINIMIZE( GtkWidget* w ){
g_object_set_data( G_OBJECT( w ), "was_mapped", gint_to_pointer( GTK_WIDGET_VISIBLE( w ) ) );
- gtk_widget_hide( w );
+ //gtk_widget_hide( w ); //fix for gtk 2.24 + the whole scheme isn't needed with gtk 2.16, 2.24; they do it all alone
}
static gboolean main_window_iconified( GtkWidget* widget, GdkEventWindowState* event, gpointer data ){
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 );
+ /* 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 ){
+ //if ( widget_is_visible( glwidget ) )
+ //globalOutputStream() << "glwidget have been already visible :0\n"; /* is not hidden aswell, according to this */
+ gtk_widget_hide( glwidget );
+ gtk_widget_show( glwidget );
+ }
gtk_widget_show( GTK_WIDGET( m_window ) );
}
void Hide(){
gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( frame ) );
}
CamWnd_setParent( *m_pCamWnd, window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", CamWnd_getWidget( *m_pCamWnd ) );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
gtk_container_add( GTK_CONTAINER( window ), GTK_WIDGET( frame ) );
}
XY_Top_Shown_Construct( window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", m_pXYWnd->GetWidget() );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
}
XZ_Front_Shown_Construct( window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", m_pXZWnd->GetWidget() );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
}
YZ_Side_Shown_Construct( window );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( window ), "glwidget", m_pYZWnd->GetWidget() );
g_floating_windows.push_back( GTK_WIDGET( window ) );
}
{
GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( GroupDialog_getWindow() ) );
g_page_textures = GroupDialog_addPage( "Textures", GTK_WIDGET( frame ), TextureBrowserExportTitleCaller() );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() );
}
GroupDialog_show();
{
GtkFrame* frame = create_framed_widget( TextureBrowser_constructWindow( window ) );
g_page_textures = GroupDialog_addPage( "Textures", GTK_WIDGET( frame ), TextureBrowserExportTitleCaller() );
+ /* workaround for gtk 2.24 issue: not displayed glwidget after toggle */
+ g_object_set_data( G_OBJECT( GroupDialog_getWindow() ), "glwidget", TextureBrowser_getGLWidget() );
}
}
Textures_setModeChangedNotify( Callback() );
}
+
+GtkWidget* TextureBrowser_getGLWidget(){
+ return GlobalTextureBrowser().m_gl_widget;
+}
void TextureBrowser_addActiveShadersChangedCallback( const SignalHandler& handler );
void TextureBrowser_addShadersRealiseCallback( const SignalHandler& handler );
+GtkWidget* TextureBrowser_getGLWidget();
+
#endif