1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-02-04 21:43:03 +00:00

(gtk) #661: Window position is not restored when unhiding from the systray

This commit is contained in:
Charles Kerr 2008-01-29 16:54:59 +00:00
parent 0f981db778
commit c58e905d11

View file

@ -914,6 +914,25 @@ msgwinclosed()
return FALSE;
}
static void
toggleMainWindow( struct cbdata * data )
{
static int x=0, y=0;
GtkWidget * w = GTK_WIDGET( data->wind );
GtkWindow * window = GTK_WINDOW( w );
if( GTK_WIDGET_VISIBLE( w ) )
{
gtk_window_get_position( window, &x, &y );
gtk_widget_hide( w );
}
else
{
gtk_window_move( window, x, y );
gtk_window_present( window );
}
}
void
doAction ( const char * action_name, gpointer user_data )
{
@ -1033,11 +1052,7 @@ doAction ( const char * action_name, gpointer user_data )
}
else if (!strcmp (action_name, "toggle-main-window"))
{
GtkWidget * w = GTK_WIDGET (data->wind);
if (GTK_WIDGET_VISIBLE(w))
gtk_widget_hide (w);
else
gtk_window_present (GTK_WINDOW(w));
toggleMainWindow( data );
}
else g_error ("Unhandled action: %s", action_name );