window: Simplify saving/loading window states

Follow https://wiki.gnome.org/HowDoI/SaveWindowState

* Use tuples in gsetting schema to save size and position
* Save changes to variable instead of saving to gsettings after every timemout
* Save the changes back to gsettings when the window is finalized.
This commit is contained in:
Mohammed Sadiq
2017-12-06 19:16:40 +05:30
parent 06f4a5b182
commit 75ad9228f6
2 changed files with 37 additions and 113 deletions
+4 -4
View File
@@ -6,13 +6,13 @@
<summary>Window maximized</summary>
<description>Window maximized state</description>
</key>
<key name="window-size" type="ai">
<default>[768, 600]</default>
<key name="window-size" type="(ii)">
<default>(768, 600)</default>
<summary>Window size</summary>
<description>Window size (width and height).</description>
</key>
<key name="window-position" type="ai">
<default>[]</default>
<key name="window-position" type="(ii)">
<default>(-1, -1)</default>
<summary>Window position</summary>
<description>Window position (x and y).</description>
</key>