restore position for hidden windows
This commit is contained in:
parent
0a17ae4dcb
commit
404f5ee056
2 changed files with 25 additions and 2 deletions
|
@ -139,13 +139,13 @@ namespace Webpin {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool edit_property (string propertie, string val) {
|
public bool edit_property (string property, string val) {
|
||||||
bool return_value = false;
|
bool return_value = false;
|
||||||
try {
|
try {
|
||||||
string filename = GLib.Environment.get_user_data_dir () + "/applications/" + file.get_string ("Desktop Entry", "Name") + "-webpin.desktop";
|
string filename = GLib.Environment.get_user_data_dir () + "/applications/" + file.get_string ("Desktop Entry", "Name") + "-webpin.desktop";
|
||||||
file = new GLib.KeyFile ();
|
file = new GLib.KeyFile ();
|
||||||
file.load_from_file (filename, KeyFileFlags.NONE);
|
file.load_from_file (filename, KeyFileFlags.NONE);
|
||||||
file.set_string ("Desktop Entry", propertie, val);
|
file.set_string ("Desktop Entry", property, val);
|
||||||
return_value = file.save_to_file (filename);
|
return_value = file.save_to_file (filename);
|
||||||
} catch (Error err) {
|
} catch (Error err) {
|
||||||
warning (err.message);
|
warning (err.message);
|
||||||
|
@ -154,6 +154,20 @@ namespace Webpin {
|
||||||
return return_value;
|
return return_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public new string get_property (string property) {
|
||||||
|
string return_value = "";
|
||||||
|
try {
|
||||||
|
string filename = GLib.Environment.get_user_data_dir () + "/applications/" + file.get_string ("Desktop Entry", "Name") + "-webpin.desktop";
|
||||||
|
file = new GLib.KeyFile ();
|
||||||
|
file.load_from_file (filename, KeyFileFlags.NONE);
|
||||||
|
return_value = file.get_string ("Desktop Entry", property);
|
||||||
|
} catch (Error err) {
|
||||||
|
warning (err.message);
|
||||||
|
}
|
||||||
|
|
||||||
|
return return_value;
|
||||||
|
}
|
||||||
|
|
||||||
public GLib.DesktopAppInfo save_to_file () {
|
public GLib.DesktopAppInfo save_to_file () {
|
||||||
GLib.DesktopAppInfo return_value = null;
|
GLib.DesktopAppInfo return_value = null;
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -135,6 +135,15 @@ namespace Webpin.Windows {
|
||||||
load_settings ();
|
load_settings ();
|
||||||
|
|
||||||
this.show_all ();
|
this.show_all ();
|
||||||
|
|
||||||
|
this.show.connect (
|
||||||
|
() => {
|
||||||
|
var x = desktop_file.get_property ("X-Webpin-WindowX");
|
||||||
|
var y = desktop_file.get_property ("X-Webpin-WindowY");
|
||||||
|
if (x != null && y != null) {
|
||||||
|
this.move (int.parse (x), int.parse (y));
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private void set_color (Gdk.RGBA color) {
|
private void set_color (Gdk.RGBA color) {
|
||||||
|
|
Loading…
Reference in a new issue