Changeset 4861


Ignore:
Timestamp:
Jan 29, 2008, 4:54:59 PM (14 years ago)
Author:
charles
Message:

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r4858 r4861  
    915915}
    916916
     917static void
     918toggleMainWindow( struct cbdata * data )
     919{
     920    static int x=0, y=0;
     921    GtkWidget * w = GTK_WIDGET( data->wind );
     922    GtkWindow * window = GTK_WINDOW( w );
     923
     924    if( GTK_WIDGET_VISIBLE( w ) )
     925    {
     926        gtk_window_get_position( window, &x, &y );
     927        gtk_widget_hide( w );
     928    }
     929    else
     930    {
     931        gtk_window_move( window, x, y );
     932        gtk_window_present( window );
     933    }
     934}
     935
    917936void
    918937doAction ( const char * action_name, gpointer user_data )
     
    10341053    else if (!strcmp (action_name, "toggle-main-window"))
    10351054    {
    1036         GtkWidget * w = GTK_WIDGET (data->wind);
    1037         if (GTK_WIDGET_VISIBLE(w))
    1038             gtk_widget_hide (w);
    1039         else
    1040             gtk_window_present (GTK_WINDOW(w));
     1055        toggleMainWindow( data );
    10411056    }
    10421057    else g_error ("Unhandled action: %s", action_name );
Note: See TracChangeset for help on using the changeset viewer.