From a8246261adc73542773e9fb56568003b4af738d1 Mon Sep 17 00:00:00 2001 From: moons14 Date: Wed, 5 Aug 2026 03:54:14 +0900 Subject: [PATCH] noctalia: add taskbar overview command hook (#61) --- .../patches/window-switcher-labwc.patch | 55 ++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) diff --git a/modules/applications/noctalia/patches/window-switcher-labwc.patch b/modules/applications/noctalia/patches/window-switcher-labwc.patch index 0cf2f6e..3dc72ab 100644 --- a/modules/applications/noctalia/patches/window-switcher-labwc.patch +++ b/modules/applications/noctalia/patches/window-switcher-labwc.patch @@ -23,4 +23,57 @@ diff --git a/src/shell/switcher/window_switcher.cpp b/src/shell/switcher/window_ + } if (key.empty()) { continue; - } \ No newline at end of file + } +diff --git a/src/shell/bar/widgets/taskbar_widget.cpp b/src/shell/bar/widgets/taskbar_widget.cpp +--- a/src/shell/bar/widgets/taskbar_widget.cpp ++++ b/src/shell/bar/widgets/taskbar_widget.cpp +@@ -5,6 +5,7 @@ + #include "compositors/workspace_backend.h" + #include "config/config_service.h" + #include "core/deferred_call.h" ++#include "core/process/process.h" + #include "i18n/i18n.h" + #include "render/core/color.h" + #include "render/core/renderer.h" +@@ -36,6 +37,18 @@ + + namespace { + ++ [[nodiscard]] bool launchTaskbarOverview(const std::string& appId) { ++ constexpr const char* command = "noctalia-taskbar-overview"; ++ if (appId.empty() || !process::commandExists(command)) { ++ return false; ++ } ++ return process::runAsync({ ++ command, ++ "--app-id", ++ appId.c_str(), ++ }); ++ } ++ + // Integer centering; optional odd spare pixel on the end side (right/bottom). + [[nodiscard]] float centeredOffset(float extent, float content, float inset = 0.0F, bool oddSpareOnEnd = true) { + const float inner = std::max(0.0F, extent - inset * 2.0F); +@@ -373,6 +386,12 @@ void TaskbarWidget::activateOrLaunchPinned(const TaskModel& task) { + return; + } + ++ const std::string overviewAppId = ++ !task.appId.empty() ? task.appId : (!task.desktopEntryId.empty() ? task.desktopEntryId : task.idLower); ++ if (launchTaskbarOverview(overviewAppId)) { ++ return; ++ } ++ + const std::string cycleKey = !task.desktopEntryId.empty() ? task.desktopEntryId : task.idLower; + std::size_t& cursor = m_groupedAppCycleCursor[cycleKey]; + if (cursor >= windows.size()) { +@@ -792,6 +811,9 @@ void TaskbarWidget::create() { + } + if (data.button == BTN_LEFT) { + if (!cycleCandidates.empty()) { ++ if (cycleCandidates.size() > 1 && launchTaskbarOverview(current->appId)) { ++ return; ++ } + std::size_t& cursor = m_groupedAppCycleCursor[cycleKey]; + if (cursor >= cycleCandidates.size()) { + cursor = 0;