mirror of
https://github.com/transmission/transmission
synced 2024-12-24 08:43:27 +00:00
(trunk gtk) #2201: transmission doesn't remember maximized state
This commit is contained in:
parent
17cb7945ed
commit
859c1b6fff
4 changed files with 15 additions and 1 deletions
|
@ -180,6 +180,7 @@ tr_prefs_init_defaults( tr_benc * d )
|
|||
|
||||
tr_bencDictAddBool( d, PREF_KEY_OPTIONS_PROMPT, TRUE );
|
||||
|
||||
tr_bencDictAddBool( d, PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED, FALSE );
|
||||
tr_bencDictAddInt( d, PREF_KEY_MAIN_WINDOW_HEIGHT, 500 );
|
||||
tr_bencDictAddInt( d, PREF_KEY_MAIN_WINDOW_WIDTH, 300 );
|
||||
tr_bencDictAddInt( d, PREF_KEY_MAIN_WINDOW_X, 50 );
|
||||
|
|
10
gtk/main.c
10
gtk/main.c
|
@ -247,6 +247,8 @@ onMainWindowSizeAllocated( GtkWidget * window,
|
|||
&& ( gdk_window_get_state( window->window )
|
||||
& GDK_WINDOW_STATE_MAXIMIZED );
|
||||
|
||||
pref_int_set( PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED, isMaximized );
|
||||
|
||||
if( !isMaximized )
|
||||
{
|
||||
int x, y, w, h;
|
||||
|
@ -711,6 +713,14 @@ wannaquit( void * vdata )
|
|||
/* clear the UI */
|
||||
gtk_list_store_clear( GTK_LIST_STORE( tr_core_model( cbdata->core ) ) );
|
||||
|
||||
/* ensure the window is in its previous position & size.
|
||||
* this seems to be necessary because changing the main window's
|
||||
* child seems to unset the size */
|
||||
gtk_window_resize( cbdata->wind, pref_int_get( PREF_KEY_MAIN_WINDOW_WIDTH ),
|
||||
pref_int_get( PREF_KEY_MAIN_WINDOW_HEIGHT ) );
|
||||
gtk_window_move( cbdata->wind, pref_int_get( PREF_KEY_MAIN_WINDOW_X ),
|
||||
pref_int_get( PREF_KEY_MAIN_WINDOW_Y ) );
|
||||
|
||||
/* shut down libT */
|
||||
g_thread_create( quitThreadFunc, vdata, TRUE, NULL );
|
||||
}
|
||||
|
|
|
@ -45,5 +45,6 @@ GtkWidget * tr_prefs_dialog_new( GObject * core,
|
|||
#define PREF_KEY_MAIN_WINDOW_WIDTH "main-window-width"
|
||||
#define PREF_KEY_MAIN_WINDOW_X "main-window-x"
|
||||
#define PREF_KEY_MAIN_WINDOW_Y "main-window-y"
|
||||
#define PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED "main-window-is-maximized"
|
||||
|
||||
#endif
|
||||
|
|
|
@ -832,7 +832,9 @@ tr_window_new( GtkUIManager * ui_mgr, TrCore * core )
|
|||
pref_int_get( PREF_KEY_MAIN_WINDOW_WIDTH ),
|
||||
pref_int_get( PREF_KEY_MAIN_WINDOW_HEIGHT ) );
|
||||
gtk_window_move( win, pref_int_get( PREF_KEY_MAIN_WINDOW_X ),
|
||||
pref_int_get( PREF_KEY_MAIN_WINDOW_Y ) );
|
||||
pref_int_get( PREF_KEY_MAIN_WINDOW_Y ) );
|
||||
if( pref_flag_get( PREF_KEY_MAIN_WINDOW_IS_MAXIMIZED ) )
|
||||
gtk_window_maximize( win );
|
||||
gtk_window_add_accel_group( win, gtk_ui_manager_get_accel_group( ui_mgr ) );
|
||||
|
||||
/* window's main container */
|
||||
|
|
Loading…
Reference in a new issue