summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org.mate.system-monitor.gschema.xml.in.in18
-rw-r--r--src/procman.cpp17
2 files changed, 9 insertions, 26 deletions
diff --git a/src/org.mate.system-monitor.gschema.xml.in.in b/src/org.mate.system-monitor.gschema.xml.in.in
index df9e14f..7abcd11 100644
--- a/src/org.mate.system-monitor.gschema.xml.in.in
+++ b/src/org.mate.system-monitor.gschema.xml.in.in
@@ -1,21 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist>
<schema gettext-domain="@GETTEXT_PACKAGE@" id="org.mate.system-monitor" path="/org/mate/system-monitor/">
- <key name="width" type="i">
- <default>440</default>
- <_summary>Main Window width</_summary>
- </key>
- <key name="height" type="i">
- <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 name="window-state" type="(iiii)">
+ <default>(700, 500, 50, 50)</default>
+ <_summary>Main window size and position in the form (width, height, xpos, ypos)</_summary>
</key>
<key name="show-tree" type="b">
<default>false</default>
diff --git a/src/procman.cpp b/src/procman.cpp
index 4e8d2ce..6e99dc8 100644
--- a/src/procman.cpp
+++ b/src/procman.cpp
@@ -249,10 +249,9 @@ procman_data_new (GSettings *settings)
pd = ProcData::get_instance();
- 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");
+ g_settings_get (settings, "window-state", "(iiii)",
+ &pd->config.width, &pd->config.height,
+ &pd->config.xpos, &pd->config.ypos);
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);
@@ -526,14 +525,10 @@ procman_save_config (ProcData *data)
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 (settings, "window-state", "(iiii)",
+ data->config.width, data->config.height,
+ data->config.xpos, data->config.ypos);
g_settings_set_int (settings, "current-tab", data->config.current_tab);
-
- g_settings_sync ();
}
static guint32