Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Flow.Launcher.Infrastructure/NativeMethods.txt
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,8 @@
PBT_APMRESUMESUSPEND
PowerRegisterSuspendResumeNotification
PowerUnregisterSuspendResumeNotification
DeviceNotifyCallbackRoutine
DeviceNotifyCallbackRoutine

Check warning on line 94 in Flow.Launcher.Infrastructure/NativeMethods.txt

View workflow job for this annotation

GitHub Actions / build

Method, type or constant "DeviceNotifyCallbackRoutine" not found

Check warning on line 94 in Flow.Launcher.Infrastructure/NativeMethods.txt

View workflow job for this annotation

GitHub Actions / build

Method, type or constant "DeviceNotifyCallbackRoutine" not found

SHAppBarMessage

Check warning on line 96 in Flow.Launcher.Infrastructure/NativeMethods.txt

View workflow job for this annotation

GitHub Actions / build

This API is only available when targeting a specific CPU architecture. AnyCPU cannot generate this API.

Check warning on line 96 in Flow.Launcher.Infrastructure/NativeMethods.txt

View workflow job for this annotation

GitHub Actions / build

This API is only available when targeting a specific CPU architecture. AnyCPU cannot generate this API.
APPBARDATA

Check warning on line 97 in Flow.Launcher.Infrastructure/NativeMethods.txt

View workflow job for this annotation

GitHub Actions / build

This API is only available when targeting a specific CPU architecture. AnyCPU cannot generate this API.
ABM_ACTIVATE
1 change: 1 addition & 0 deletions Flow.Launcher.Infrastructure/UserSettings/Settings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
26 changes: 26 additions & 0 deletions Flow.Launcher.Infrastructure/Win32Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using Microsoft.Win32.SafeHandles;
using Windows.Win32;
using Windows.Win32.Foundation;
using Windows.Win32.Graphics.Dwm;

Check warning on line 21 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Dwm` is not a recognized word. (unrecognized-spelling)

Check warning on line 21 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Dwm` is not a recognized word. (unrecognized-spelling)
using Windows.Win32.System.Power;
using Windows.Win32.System.Threading;
using Windows.Win32.UI.Input.KeyboardAndMouse;
Expand All @@ -44,7 +44,7 @@
{
var cloaked = cloak ? 1 : 0;

return PInvoke.DwmSetWindowAttribute(

Check warning on line 47 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Dwm` is not a recognized word. (unrecognized-spelling)

Check warning on line 47 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`Dwm` is not a recognized word. (unrecognized-spelling)
GetWindowHandle(window),
DWMWINDOWATTRIBUTE.DWMWA_CLOAK,
&cloaked,
Expand All @@ -55,9 +55,9 @@
{
var backdropType = backdrop switch
{
BackdropTypes.Acrylic => DWM_SYSTEMBACKDROP_TYPE.DWMSBT_TRANSIENTWINDOW,

Check warning on line 58 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`SYSTEMBACKDROP` is not a recognized word. (unrecognized-spelling)

Check warning on line 58 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`SYSTEMBACKDROP` is not a recognized word. (unrecognized-spelling)
BackdropTypes.Mica => DWM_SYSTEMBACKDROP_TYPE.DWMSBT_MAINWINDOW,

Check warning on line 59 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`SYSTEMBACKDROP` is not a recognized word. (unrecognized-spelling)

Check warning on line 59 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`DWMSBT` is not a recognized word. (unrecognized-spelling)

Check warning on line 59 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`SYSTEMBACKDROP` is not a recognized word. (unrecognized-spelling)

Check warning on line 59 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`DWMSBT` is not a recognized word. (unrecognized-spelling)
BackdropTypes.MicaAlt => DWM_SYSTEMBACKDROP_TYPE.DWMSBT_TABBEDWINDOW,

Check warning on line 60 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`DWMSBT` is not a recognized word. (unrecognized-spelling)

Check warning on line 60 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / Check Spelling

`DWMSBT` is not a recognized word. (unrecognized-spelling)
_ => DWM_SYSTEMBACKDROP_TYPE.DWMSBT_AUTO
};

Expand Down Expand Up @@ -1016,5 +1016,31 @@
}

#endregion

#region Taskbar

/// <summary>
/// Shows the taskbar temporarily by activating it.
/// This is useful for auto-hidden taskbars and mimics the behavior of hovering over the taskbar edge.
/// </summary>
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

Check failure on line 1033 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1033 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1033 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1033 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)
{
cbSize = (uint)Marshal.SizeOf<APPBARDATA>(),

Check failure on line 1035 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1035 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1035 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)

Check failure on line 1035 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

The type or namespace name 'APPBARDATA' could not be found (are you missing a using directive or an assembly reference?)
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);

Check failure on line 1041 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

'PInvoke' does not contain a definition for 'SHAppBarMessage'

Check failure on line 1041 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

'PInvoke' does not contain a definition for 'SHAppBarMessage'

Check failure on line 1041 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

'PInvoke' does not contain a definition for 'SHAppBarMessage'

Check failure on line 1041 in Flow.Launcher.Infrastructure/Win32Helper.cs

View workflow job for this annotation

GitHub Actions / build

'PInvoke' does not contain a definition for 'SHAppBarMessage'
}

#endregion
}
}
2 changes: 2 additions & 0 deletions Flow.Launcher/Languages/en.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@
<system:String x:Key="useLogonTaskForStartupTooltip">After uninstallation, you need to manually remove this task (Flow.Launcher Startup) via Task Scheduler</system:String>
<system:String x:Key="setAutoStartFailed">Error setting launch on startup</system:String>
<system:String x:Key="hideFlowLauncherWhenLoseFocus">Hide Flow Launcher when focus is lost</system:String>
<system:String x:Key="showTaskbarWhenOpened">Show taskbar when Flow Launcher is opened</system:String>
<system:String x:Key="showTaskbarWhenOpenedToolTip">Temporarily show the taskbar when Flow Launcher is opened, useful for auto-hidden taskbars.</system:String>
<system:String x:Key="dontPromptUpdateMsg">Do not show new version notifications</system:String>
<system:String x:Key="SearchWindowPosition">Search Window Location</system:String>
<system:String x:Key="SearchWindowScreenRememberLastLaunchLocation">Remember Last Position</system:String>
Expand Down
10 changes: 10 additions & 0 deletions Flow.Launcher/SettingPages/Views/SettingsPaneGeneral.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,16 @@
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>

<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource showTaskbarWhenOpenedToolTip}"
Header="{DynamicResource showTaskbarWhenOpened}">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowTaskbarWhenInvoked}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>

<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource hideNotifyIconToolTip}"
Expand Down
6 changes: 6 additions & 0 deletions Flow.Launcher/ViewModel/MainViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2097,6 +2097,12 @@ public void Show()
// When application is exiting, we should not show the main window
if (App.LoadingOrExiting) return;

// Show the taskbar if the setting is enabled
if (Settings.ShowTaskbarWhenInvoked)
{
Win32Helper.ShowTaskbar();
}

// When application is exiting, the Application.Current will be null
Application.Current?.Dispatcher.Invoke(() =>
{
Expand Down
Loading