Skip to content
Snippets Groups Projects
Commit 26f2b698 authored by Emmanuel Milou's avatar Emmanuel Milou
Browse files

[#1641] Remember position when restoring window from the system tray

parent 2359a199
No related branches found
No related tags found
No related merge requests found
...@@ -48,6 +48,10 @@ GtkWidget * statusBar = NULL; ...@@ -48,6 +48,10 @@ GtkWidget * statusBar = NULL;
GtkWidget * filterEntry = NULL; GtkWidget * filterEntry = NULL;
PidginScrollBook *embedded_error_notebook; PidginScrollBook *embedded_error_notebook;
/**
* Handle main window resizing
*/
static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) { static gboolean window_configure_cb (GtkWidget *win, GdkEventConfigure *event) {
int pos_x, pos_y; int pos_x, pos_y;
...@@ -294,6 +298,7 @@ create_main_window () ...@@ -294,6 +298,7 @@ create_main_window ()
#endif #endif
} }
// Restore position according to the configuration stored in gconf
gtk_window_move (GTK_WINDOW (window), position_x, position_y); gtk_window_move (GTK_WINDOW (window), position_x, position_y);
} }
......
...@@ -35,6 +35,7 @@ void popup_main_window (void) ...@@ -35,6 +35,7 @@ void popup_main_window (void)
if (__POPUP_WINDOW) if (__POPUP_WINDOW)
{ {
gtk_widget_show (get_main_window ()); gtk_widget_show (get_main_window ());
gtk_window_move (GTK_WINDOW (get_main_window ()), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y));
set_minimized (FALSE); set_minimized (FALSE);
} }
} }
...@@ -61,6 +62,7 @@ void show_hide (void) ...@@ -61,6 +62,7 @@ void show_hide (void)
if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item))) if(gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(show_menu_item)))
{ {
gtk_widget_show(GTK_WIDGET(get_main_window())); gtk_widget_show(GTK_WIDGET(get_main_window()));
gtk_window_move (GTK_WINDOW (get_main_window ()), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_X), eel_gconf_get_integer (CONF_MAIN_WINDOW_POSITION_Y));
set_minimized( !MINIMIZED ); set_minimized( !MINIMIZED );
} }
else else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment