From 05bd6d1ad1e6123166332dbcbb3ac7b74fd9c63a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:18:49 +0000 Subject: [PATCH 1/7] Add option to show taskbar when Flow Launcher is invoked Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- .../NativeMethods.txt | 7 ++++- .../UserSettings/Settings.cs | 1 + Flow.Launcher.Infrastructure/Win32Helper.cs | 29 +++++++++++++++++-- Flow.Launcher/Languages/en.xaml | 2 ++ .../Views/SettingsPaneGeneral.xaml | 10 +++++++ Flow.Launcher/ViewModel/MainViewModel.cs | 6 ++++ 6 files changed, 52 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index cd072f635f6..38fc7a19559 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -91,4 +91,9 @@ PBT_APMRESUMEAUTOMATIC PBT_APMRESUMESUSPEND PowerRegisterSuspendResumeNotification PowerUnregisterSuspendResumeNotification -DeviceNotifyCallbackRoutine \ No newline at end of file +DeviceNotifyCallbackRoutine + +SHAppBarMessage +APPBARDATA +ABM_SETSTATE +ABS_AUTOHIDE \ No newline at end of file diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 6adefdb6a21..7524d6c1a79 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -481,6 +481,7 @@ public bool HideNotifyIcon } public bool LeaveCmdOpen { get; set; } public bool HideWhenDeactivated { get; set; } = true; + public bool ShowTaskbarWhenInvoked { get; set; } = false; private bool _showAtTopmost = false; public bool ShowAtTopmost diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 8a41e12b43c..c6936053d28 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1016,5 +1016,30 @@ protected override bool ReleaseHandle() } #endregion - } -} + + #region Taskbar + + /// + /// Shows the taskbar by temporarily disabling auto-hide if it's enabled. + /// This mimics the behavior of pressing the Windows key. + /// + public static unsafe void ShowTaskbar() + { + // Find the taskbar window + var taskbarHwnd = PInvoke.FindWindowEx(HWND.Null, HWND.Null, "Shell_TrayWnd", null); + if (taskbarHwnd == HWND.Null) return; + + // Get the current appbar data + var appBarData = new APPBARDATA + { + cbSize = (uint)Marshal.SizeOf(), + hWnd = taskbarHwnd + }; + + // Set the state to not auto-hide (ABS_AUTOHIDE = 0x0000001) + // Setting lParam to 0 will show the taskbar if it's in auto-hide mode + appBarData.lParam = 0; + PInvoke.SHAppBarMessage(PInvoke.ABM_SETSTATE, ref appBarData); + } + + #endregion diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 2a21840f7f2..e32b32dccb0 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -81,6 +81,8 @@ After uninstallation, you need to manually remove this task (Flow.Launcher Startup) via Task Scheduler Error setting launch on startup Hide Flow Launcher when focus is lost + Show taskbar when Flow Launcher is invoked + Temporarily show the taskbar when Flow Launcher is activated, useful for auto-hidden taskbars. Do not show new version notifications Search Window Location Remember Last Position diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index 720cb440b9b..c7413a5dd17 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -72,6 +72,16 @@ OnContent="{DynamicResource enable}" /> + + + + { From 8f89b86d42b6d550f60b50c27a42e510e3e3276a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:20:44 +0000 Subject: [PATCH 2/7] Fix: Use ABM_ACTIVATE instead of ABM_SETSTATE for temporary taskbar showing Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- Flow.Launcher.Infrastructure/NativeMethods.txt | 3 +-- Flow.Launcher.Infrastructure/Win32Helper.cs | 13 ++++++------- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index 38fc7a19559..a2a536a2551 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -95,5 +95,4 @@ DeviceNotifyCallbackRoutine SHAppBarMessage APPBARDATA -ABM_SETSTATE -ABS_AUTOHIDE \ No newline at end of file +ABM_ACTIVATE \ No newline at end of file diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index c6936053d28..ec8f5c3c75f 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1020,8 +1020,8 @@ protected override bool ReleaseHandle() #region Taskbar /// - /// Shows the taskbar by temporarily disabling auto-hide if it's enabled. - /// This mimics the behavior of pressing the Windows key. + /// Shows the taskbar temporarily by activating it. + /// This is useful for auto-hidden taskbars and mimics the behavior of hovering over the taskbar edge. /// public static unsafe void ShowTaskbar() { @@ -1029,17 +1029,16 @@ public static unsafe void ShowTaskbar() var taskbarHwnd = PInvoke.FindWindowEx(HWND.Null, HWND.Null, "Shell_TrayWnd", null); if (taskbarHwnd == HWND.Null) return; - // Get the current appbar data + // Prepare appbar data with the taskbar handle var appBarData = new APPBARDATA { cbSize = (uint)Marshal.SizeOf(), hWnd = taskbarHwnd }; - // Set the state to not auto-hide (ABS_AUTOHIDE = 0x0000001) - // Setting lParam to 0 will show the taskbar if it's in auto-hide mode - appBarData.lParam = 0; - PInvoke.SHAppBarMessage(PInvoke.ABM_SETSTATE, ref appBarData); + // Send ABM_ACTIVATE to temporarily show the taskbar + // This activates the taskbar without permanently changing its auto-hide state + PInvoke.SHAppBarMessage(PInvoke.ABM_ACTIVATE, ref appBarData); } #endregion From bed345790fc8f4d596d12425effae41ace7d849c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 14:22:14 +0000 Subject: [PATCH 3/7] Remove unnecessary unsafe keyword from ShowTaskbar method Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- Flow.Launcher.Infrastructure/Win32Helper.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index ec8f5c3c75f..7c130326044 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1023,7 +1023,7 @@ protected override bool ReleaseHandle() /// Shows the taskbar temporarily by activating it. /// This is useful for auto-hidden taskbars and mimics the behavior of hovering over the taskbar edge. /// - public static unsafe void ShowTaskbar() + public static void ShowTaskbar() { // Find the taskbar window var taskbarHwnd = PInvoke.FindWindowEx(HWND.Null, HWND.Null, "Shell_TrayWnd", null); From 1b345d2a460263edfda731cbdfbf62e04ce7183d Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:04:29 +0000 Subject: [PATCH 4/7] Fix missing closing braces in Win32Helper.cs Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- Flow.Launcher.Infrastructure/Win32Helper.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 7c130326044..30b5e27beb9 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1042,3 +1042,5 @@ public static void ShowTaskbar() } #endregion + } +} From 586944cdcff2889ec885e1b2938ef8064f21dd3c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 15 Dec 2025 15:11:22 +0000 Subject: [PATCH 5/7] Change wording from 'invoked' to 'opened' in localization strings Co-authored-by: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> --- Flow.Launcher/Languages/en.xaml | 4 ++-- Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index e32b32dccb0..145e1883dd0 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -81,8 +81,8 @@ After uninstallation, you need to manually remove this task (Flow.Launcher Startup) via Task Scheduler Error setting launch on startup Hide Flow Launcher when focus is lost - Show taskbar when Flow Launcher is invoked - Temporarily show the taskbar when Flow Launcher is activated, useful for auto-hidden taskbars. + Show taskbar when Flow Launcher is opened + Temporarily show the taskbar when Flow Launcher is opened, useful for auto-hidden taskbars. Do not show new version notifications Search Window Location Remember Last Position diff --git a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml index c7413a5dd17..b4c94cb354b 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -74,8 +74,8 @@ + Description="{DynamicResource showTaskbarWhenOpenedToolTip}" + Header="{DynamicResource showTaskbarWhenOpened}"> Date: Sun, 21 Dec 2025 18:57:13 +0800 Subject: [PATCH 6/7] Show/hide tasking when showing/hiding Flow --- .../NativeMethods.txt | 4 +- Flow.Launcher.Infrastructure/Win32Helper.cs | 41 ++++++++++++------- Flow.Launcher/ViewModel/MainViewModel.cs | 5 +++ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index a2a536a2551..8c5633cfef5 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -93,6 +93,4 @@ PowerRegisterSuspendResumeNotification PowerUnregisterSuspendResumeNotification DeviceNotifyCallbackRoutine -SHAppBarMessage -APPBARDATA -ABM_ACTIVATE \ No newline at end of file +MonitorFromWindow \ No newline at end of file diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 30b5e27beb9..5419de36eeb 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -27,6 +27,7 @@ using Point = System.Windows.Point; using SystemFonts = System.Windows.SystemFonts; + namespace Flow.Launcher.Infrastructure { public static class Win32Helper @@ -1019,26 +1020,38 @@ protected override bool ReleaseHandle() #region Taskbar - /// - /// Shows the taskbar temporarily by activating it. - /// This is useful for auto-hidden taskbars and mimics the behavior of hovering over the taskbar edge. - /// - public static void ShowTaskbar() + public static unsafe void ShowTaskbar() { // Find the taskbar window var taskbarHwnd = PInvoke.FindWindowEx(HWND.Null, HWND.Null, "Shell_TrayWnd", null); if (taskbarHwnd == HWND.Null) return; - // Prepare appbar data with the taskbar handle - var appBarData = new APPBARDATA - { - cbSize = (uint)Marshal.SizeOf(), - hWnd = taskbarHwnd - }; + // Magic from https://github.com/Oliviaophia/SmartTaskbar + const uint TrayBarFlag = 0x05D1; + var mon = PInvoke.MonitorFromWindow(taskbarHwnd, Windows.Win32.Graphics.Gdi.MONITOR_FROM_FLAGS.MONITOR_DEFAULTTONEAREST); + PInvoke.PostMessage(taskbarHwnd, TrayBarFlag, new WPARAM(1), new LPARAM((nint)mon.Value)); + } + + public static void HideTaskbar() + { + // Find the taskbar window + var taskbarHwnd = PInvoke.FindWindowEx(HWND.Null, HWND.Null, "Shell_TrayWnd", null); + if (taskbarHwnd == HWND.Null) return; - // Send ABM_ACTIVATE to temporarily show the taskbar - // This activates the taskbar without permanently changing its auto-hide state - PInvoke.SHAppBarMessage(PInvoke.ABM_ACTIVATE, ref appBarData); + // Magic from https://github.com/Oliviaophia/SmartTaskbar + const uint TrayBarFlag = 0x05D1; + PInvoke.PostMessage(taskbarHwnd, TrayBarFlag, new WPARAM(0), IntPtr.Zero); + } + + [StructLayout(LayoutKind.Sequential)] + private struct APPBARDATA + { + public uint cbSize; + public HWND hWnd; + public uint uCallbackMessage; + public uint uEdge; + public RECT rc; + public nint lParam; } #endregion diff --git a/Flow.Launcher/ViewModel/MainViewModel.cs b/Flow.Launcher/ViewModel/MainViewModel.cs index d0d883cd0f4..283f200a1d3 100644 --- a/Flow.Launcher/ViewModel/MainViewModel.cs +++ b/Flow.Launcher/ViewModel/MainViewModel.cs @@ -2208,6 +2208,11 @@ public async void Hide(bool reset = true) Win32Helper.RestorePreviousKeyboardLayout(); } + if (Settings.ShowTaskbarWhenInvoked) + { + Win32Helper.HideTaskbar(); + } + // Delay for a while to make sure clock will not flicker await Task.Delay(50); From a096729fbb4e64e662063b722ee759fb2df0e244 Mon Sep 17 00:00:00 2001 From: VictoriousRaptor <10308169+VictoriousRaptor@users.noreply.github.com> Date: Tue, 23 Dec 2025 00:10:25 +0800 Subject: [PATCH 7/7] Remove unused APPBARDATA --- Flow.Launcher.Infrastructure/Win32Helper.cs | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/Flow.Launcher.Infrastructure/Win32Helper.cs b/Flow.Launcher.Infrastructure/Win32Helper.cs index 5419de36eeb..4f6858c31b1 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1043,17 +1043,6 @@ public static void HideTaskbar() PInvoke.PostMessage(taskbarHwnd, TrayBarFlag, new WPARAM(0), IntPtr.Zero); } - [StructLayout(LayoutKind.Sequential)] - private struct APPBARDATA - { - public uint cbSize; - public HWND hWnd; - public uint uCallbackMessage; - public uint uEdge; - public RECT rc; - public nint lParam; - } - #endregion } }