From f11964cd26663b027a9dc24e793798f22c3aecdc Mon Sep 17 00:00:00 2001 From: Alessandro Date: Tue, 24 Sep 2019 17:36:14 -0700 Subject: [PATCH 1/2] Add fix for kde plasma Setting the window hint type to utility does not seem to function well with plasma, peek will not show up in the task manager or task switcher. This checks if the user is using plasma and changes the hint type to normal. --- src/ui/application-window.vala | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala index 08ffa123..e704136a 100644 --- a/src/ui/application-window.vala +++ b/src/ui/application-window.vala @@ -181,6 +181,9 @@ namespace Peek.Ui { SettingsBindFlags.DEFAULT); // Configure window + if (DesktopIntegration.is_plasma () ) { + type_hint =NORMAL; + } this.set_keep_above (true); this.load_geometry (); this.on_window_screen_changed (null); From b5ef7fa5af14abb72a1bb6432195e56065030358 Mon Sep 17 00:00:00 2001 From: Alessandro Toia Date: Wed, 25 Sep 2019 17:25:06 -0700 Subject: [PATCH 2/2] Check if using a tiling wm, if so set hint type to utlity --- src/desktop-integration.vala | 16 ++++++++++++++++ src/ui/application-window.vala | 5 +++-- ui/application-window.ui | 2 +- 3 files changed, 20 insertions(+), 3 deletions(-) diff --git a/src/desktop-integration.vala b/src/desktop-integration.vala index 020d738e..79c21ead 100644 --- a/src/desktop-integration.vala +++ b/src/desktop-integration.vala @@ -127,6 +127,22 @@ namespace Peek { return folder; } + public static bool is_tiling () { + var tiling_window =true; + var de_list = new List (); + de_list.append ("Unity"); + de_list.append ("GNOME"); + de_list.append ("X-Cinnamon"); + de_list.append ("XFCE"); + de_list.append ("KDE"); + foreach (string element in de_list) { + if ( xdg_current_desktop_contains (element) ) { + tiling_window = false; + stdout.printf ("Using %s Desktop Environment\n", element); + } + } + return tiling_window; + } public static bool is_unity () { return xdg_current_desktop_contains ("Unity"); diff --git a/src/ui/application-window.vala b/src/ui/application-window.vala index e704136a..dd21cd37 100644 --- a/src/ui/application-window.vala +++ b/src/ui/application-window.vala @@ -181,9 +181,10 @@ namespace Peek.Ui { SettingsBindFlags.DEFAULT); // Configure window - if (DesktopIntegration.is_plasma () ) { - type_hint =NORMAL; + if (DesktopIntegration.is_tiling () ){ + this.type_hint= UTILITY; } + this.set_keep_above (true); this.load_geometry (); this.on_window_screen_changed (null); diff --git a/ui/application-window.ui b/ui/application-window.ui index c3560e95..edb3ca26 100644 --- a/ui/application-window.ui +++ b/ui/application-window.ui @@ -111,7 +111,7 @@ Author: Philipp Wolfer 440 250 com.uploadedlobster.peek - utility + normal False