From cb9ccb576fca37b307ba26cd489535c2fe6fdc6d Mon Sep 17 00:00:00 2001 From: DanyLE Date: Fri, 6 Jan 2023 21:45:05 +0100 Subject: [PATCH] Hide application when use click on active application dock item --- src/core/tags/AppDockTag.ts | 9 ++++++++- src/core/tags/WindowTag.ts | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/core/tags/AppDockTag.ts b/src/core/tags/AppDockTag.ts index 7c258a2..68a9193 100644 --- a/src/core/tags/AppDockTag.ts +++ b/src/core/tags/AppDockTag.ts @@ -293,7 +293,14 @@ namespace OS { } if(collection.length == 1) { - collection[0].app.trigger("focus"); + if(PM.getActiveApp() == collection[0].app) + { + collection[0].app.hide(); + } + else + { + collection[0].app.show(); + } resolve(collection[0].app); return; } diff --git a/src/core/tags/WindowTag.ts b/src/core/tags/WindowTag.ts index 4d789f0..842fb1f 100644 --- a/src/core/tags/WindowTag.ts +++ b/src/core/tags/WindowTag.ts @@ -104,6 +104,7 @@ namespace OS { get blur_overlay(): boolean { return this.hasattr("blur-overlay"); } + /** * Setter: set menu open event handler *