(trunk gtk) #3146 "Toggle state of 'toggle-main-window' not updated when window is shown after launch with running instance" -- fixed in trunk for 2.00 by a patch from qense

This commit is contained in:
Charles Kerr 2010-04-17 00:41:24 +00:00
parent 0723193fc7
commit c8ba63ca07
3 changed files with 7 additions and 10 deletions

View File

@ -132,7 +132,6 @@ static GtkActionEntry entries[] =
{ "show-about-dialog", GTK_STOCK_ABOUT, NULL, NULL, NULL, G_CALLBACK( action_cb ) },
{ "help", GTK_STOCK_HELP, N_( "_Contents" ), "F1", NULL, G_CALLBACK( action_cb ) },
{ "update-tracker", GTK_STOCK_NETWORK, N_( "Ask Tracker for _More Peers" ), NULL, NULL, G_CALLBACK( action_cb ) },
{ "present-main-window", NULL, NULL, NULL, NULL, G_CALLBACK( action_cb ) },
};
typedef struct

View File

@ -735,15 +735,14 @@ tr_window_present( GtkWindow * window )
}
static void
toggleMainWindow( struct cbdata * cbdata,
gboolean doPresent )
toggleMainWindow( struct cbdata * cbdata )
{
GtkWindow * window = GTK_WINDOW( cbdata->wind );
const int doShow = cbdata->isIconified;
static int x = 0;
static int y = 0;
if( doShow || doPresent )
if( doShow )
{
cbdata->isIconified = 0;
gtk_window_set_skip_taskbar_hint( window, FALSE );
@ -1692,11 +1691,7 @@ doAction( const char * action_name, gpointer user_data )
}
else if( !strcmp( action_name, "toggle-main-window" ) )
{
toggleMainWindow( data, FALSE );
}
else if( !strcmp( action_name, "present-main-window" ) )
{
toggleMainWindow( data, TRUE );
toggleMainWindow( data );
}
else g_error ( "Unhandled action: %s", action_name );

View File

@ -1124,7 +1124,10 @@ tr_core_present_window( TrCore * core UNUSED,
gboolean * success,
GError ** err UNUSED )
{
action_activate( "present-main-window" );
/* Setting the toggle-main-window GtkCheckMenuItem to
make sure its state is correctly set */
action_toggle( "toggle-main-window", TRUE);
*success = TRUE;
return TRUE;
}