diff options
-rw-r--r-- | src/interface.cpp | 5 | ||||
-rw-r--r-- | src/org.mate.system-monitor.gschema.xml.in.in | 8 | ||||
-rw-r--r-- | src/procman.cpp | 7 | ||||
-rw-r--r-- | src/procman.h | 2 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/interface.cpp b/src/interface.cpp index 7b5b96f..3561ea2 100644 --- a/src/interface.cpp +++ b/src/interface.cpp @@ -635,7 +635,7 @@ void create_main_window (ProcData *procdata) { gint i; - gint width, height; + gint width, height, xpos, ypos; GtkWidget *app; GtkAction *action; GtkWidget *menubar; @@ -667,7 +667,10 @@ create_main_window (ProcData *procdata) width = procdata->config.width; height = procdata->config.height; + xpos = procdata->config.xpos; + ypos = procdata->config.ypos; gtk_window_set_default_size (GTK_WINDOW (app), width, height); + gtk_window_move(GTK_WINDOW (app), xpos, ypos); gtk_window_set_resizable (GTK_WINDOW (app), TRUE); /* create the menubar */ diff --git a/src/org.mate.system-monitor.gschema.xml.in.in b/src/org.mate.system-monitor.gschema.xml.in.in index 56e249f..df9e14f 100644 --- a/src/org.mate.system-monitor.gschema.xml.in.in +++ b/src/org.mate.system-monitor.gschema.xml.in.in @@ -9,6 +9,14 @@ <default>495</default> <_summary>Main Window height</_summary> </key> + <key name="x-position" type="i"> + <default>0</default> + <_summary>Main Window X position</_summary> + </key> + <key name="y-position" type="i"> + <default>0</default> + <_summary>Main Window Y position</_summary> + </key> <key name="show-tree" type="b"> <default>false</default> <_summary>Show process dependencies in tree form</_summary> diff --git a/src/procman.cpp b/src/procman.cpp index d11c7eb..c19edb7 100644 --- a/src/procman.cpp +++ b/src/procman.cpp @@ -251,6 +251,9 @@ procman_data_new (GSettings *settings) pd->config.width = g_settings_get_int (settings, "width"); pd->config.height = g_settings_get_int (settings, "height"); + pd->config.xpos = g_settings_get_int (settings, "x-position"); + pd->config.ypos = g_settings_get_int (settings, "y-position"); + pd->config.show_tree = g_settings_get_boolean (settings, "show-tree"); g_signal_connect (G_OBJECT(settings), "changed::show-tree", G_CALLBACK(tree_changed_cb), pd); @@ -546,9 +549,13 @@ procman_save_config (ProcData *data) data->config.width = gdk_window_get_width(gtk_widget_get_window(data->app)); data->config.height = gdk_window_get_height(gtk_widget_get_window(data->app)); + gtk_window_get_position(GTK_WINDOW(data->app), &data->config.xpos, &data->config.ypos); g_settings_set_int (settings, "width", data->config.width); g_settings_set_int (settings, "height", data->config.height); + g_settings_set_int (settings, "x-position", data->config.xpos); + g_settings_set_int (settings, "y-position", data->config.ypos); + g_settings_set_int (settings, "current-tab", data->config.current_tab); } diff --git a/src/procman.h b/src/procman.h index 6b934e3..f359667 100644 --- a/src/procman.h +++ b/src/procman.h @@ -74,6 +74,8 @@ struct ProcConfig { gint width; gint height; + gint xpos; + gint ypos; gboolean show_kill_warning; gboolean show_tree; gboolean show_all_fs; |