Changeset 12980


Ignore:
Timestamp:
Oct 13, 2011, 12:36:19 AM (10 years ago)
Author:
jordan
Message:

(trunk gtk) #4553 "Set about dialog to modal when compiled with GTK+-3" -- fix About dialog issue when hiding and then re-showing Transmission.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/util.c

    r12963 r12980  
    494494}
    495495
     496#define GTR_CHILD_HIDDEN "gtr-child-hidden"
     497
    496498void
    497499gtr_widget_set_visible( GtkWidget * w, gboolean b )
     
    505507
    506508        for( l=windows; l!=NULL; l=l->next )
    507             if( GTK_IS_WINDOW( l->data ) )
    508                 if( gtk_window_get_transient_for( GTK_WINDOW( l->data ) ) == window )
    509                     gtr_widget_set_visible( GTK_WIDGET( l->data ), b );
     509        {
     510            if( !GTK_IS_WINDOW( l->data ) )
     511                continue;
     512            if( gtk_window_get_transient_for( GTK_WINDOW( l->data ) ) != window )
     513                continue;
     514            if( gtk_widget_get_visible( GTK_WIDGET( l->data ) ) == b )
     515                continue;
     516
     517            if( b && g_object_get_data( G_OBJECT( l->data ), GTR_CHILD_HIDDEN ) != NULL )
     518            {
     519                g_object_steal_data( G_OBJECT( l->data ), GTR_CHILD_HIDDEN );
     520                gtr_widget_set_visible( GTK_WIDGET( l->data ), TRUE );
     521            }
     522            else if( !b )
     523            {
     524                g_object_set_data( G_OBJECT( l->data ), GTR_CHILD_HIDDEN, GINT_TO_POINTER( 1 ) );
     525                gtr_widget_set_visible( GTK_WIDGET( l->data ), FALSE );
     526            }
     527        }
    510528
    511529        g_list_free( windows );
Note: See TracChangeset for help on using the changeset viewer.