diff --git a/Flow.Launcher.Infrastructure/NativeMethods.txt b/Flow.Launcher.Infrastructure/NativeMethods.txt index cd072f635f6..a2a536a2551 100644 --- a/Flow.Launcher.Infrastructure/NativeMethods.txt +++ b/Flow.Launcher.Infrastructure/NativeMethods.txt @@ -91,4 +91,8 @@ PBT_APMRESUMEAUTOMATIC PBT_APMRESUMESUSPEND PowerRegisterSuspendResumeNotification PowerUnregisterSuspendResumeNotification -DeviceNotifyCallbackRoutine \ No newline at end of file +DeviceNotifyCallbackRoutine + +SHAppBarMessage +APPBARDATA +ABM_ACTIVATE \ 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..30b5e27beb9 100644 --- a/Flow.Launcher.Infrastructure/Win32Helper.cs +++ b/Flow.Launcher.Infrastructure/Win32Helper.cs @@ -1016,5 +1016,31 @@ protected override bool ReleaseHandle() } #endregion + + #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() + { + // 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 + }; + + // 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 } } diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index 2a21840f7f2..145e1883dd0 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 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 720cb440b9b..b4c94cb354b 100644 --- a/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml +++ b/Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml @@ -72,6 +72,16 @@ OnContent="{DynamicResource enable}" /> + + + + {