diff options
author | infirit <[email protected]> | 2014-12-18 20:32:15 +0100 |
---|---|---|
committer | infirit <[email protected]> | 2014-12-18 20:32:15 +0100 |
commit | db877ef14b15c2c2f8572954589fc81fcf6d8626 (patch) | |
tree | bf53a755c8b0c16ef77681d418d47cc9b7948139 | |
parent | 01735cf7050926fb1c1de8adecb391c657ad2204 (diff) | |
download | mate-system-monitor-db877ef14b15c2c2f8572954589fc81fcf6d8626.tar.bz2 mate-system-monitor-db877ef14b15c2c2f8572954589fc81fcf6d8626.tar.xz |
Use a tuple to store window state
Taken from GSM commit: d347dd13681b7f57b28bc609d94cbcc597049951
From: Stefano Facchini <[email protected]>
Gnome bug: https://bugzilla.gnome.org/show_bug.cgi?id=649398
-rw-r--r-- | src/org.mate.system-monitor.gschema.xml.in.in | 18 | ||||
-rw-r--r-- | src/procman.cpp | 17 |
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 |