summaryrefslogtreecommitdiff
path: root/src/pies/pieManager.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/pies/pieManager.vala')
-rw-r--r--src/pies/pieManager.vala21
1 files changed, 18 insertions, 3 deletions
diff --git a/src/pies/pieManager.vala b/src/pies/pieManager.vala
index 162a61f..85d8a14 100644
--- a/src/pies/pieManager.vala
+++ b/src/pies/pieManager.vala
@@ -52,6 +52,14 @@ public class PieManager : GLib.Object {
private static bool a_pie_is_active = false;
/////////////////////////////////////////////////////////////////////
+ /// Storing the position of the last Pie. Used for subpies, which are
+ /// opened at their parents location.
+ /////////////////////////////////////////////////////////////////////
+
+ private static int last_x = 0;
+ private static int last_y = 0;
+
+ /////////////////////////////////////////////////////////////////////
/// Initializes all Pies. They are loaded from the pies.conf file.
/////////////////////////////////////////////////////////////////////
@@ -73,28 +81,35 @@ public class PieManager : GLib.Object {
/// Opens the Pie with the given ID, if it exists.
/////////////////////////////////////////////////////////////////////
- public static void open_pie(string id) {
+ public static void open_pie(string id, bool at_last_position = false) {
if (!a_pie_is_active) {
Pie? pie = all_pies[id];
if (pie != null) {
+ Logger.stats("OPEN " + id);
+
a_pie_is_active = true;
var window = new PieWindow();
window.load_pie(pie);
- window.open();
+
+ if (at_last_position) {
+ window.open_at(last_x, last_y);
+ } else {
+ window.open();
+ }
opened_windows.add(window);
window.on_closed.connect(() => {
opened_windows.remove(window);
if (opened_windows.size == 0) {
- ThemedIcon.clear_cache();
Icon.clear_cache();
}
});
window.on_closing.connect(() => {
+ window.get_center_pos(out last_x, out last_y);
a_pie_is_active = false;
});