diff --git a/VERSION b/VERSION index 3eefcb9..7dea76e 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.0.0 +1.0.1 diff --git a/bootstrap/payload/SlipperyContext.Diagnostics.cs b/bootstrap/payload/SlipperyContext.Diagnostics.cs index 1081993..662670c 100644 --- a/bootstrap/payload/SlipperyContext.Diagnostics.cs +++ b/bootstrap/payload/SlipperyContext.Diagnostics.cs @@ -20,7 +20,7 @@ private void CopyDiagnostics() { StringBuilder b = new StringBuilder(); b.AppendLine("Slippery Taskbar C# diagnostics"); - b.AppendLine("Build: 1.0.0"); + b.AppendLine("Build: 1.0.1"); b.AppendLine("Runtime: " + Environment.Version); b.AppendLine("OS: " + Environment.OSVersion); b.AppendLine("Executable: " + Application.ExecutablePath); diff --git a/bootstrap/payload/TaskbarController.Core.cs b/bootstrap/payload/TaskbarController.Core.cs index 21a84fe..d3d18a1 100644 --- a/bootstrap/payload/TaskbarController.Core.cs +++ b/bootstrap/payload/TaskbarController.Core.cs @@ -72,12 +72,6 @@ public void ApplyVisibility(bool show) foreach (IntPtr h in _taskbars) { if (!NativeMethods.IsWindow(h)) continue; - - // Match Buttery Taskbar's least-invasive visibility model: one - // synchronous ShowWindow call, with Explorer left in control of the - // taskbar's own auto-hide/XAML animation and position. Do not pair - // this with SetWindowPos or force the bar back onto the monitor; those - // operations can fight Explorer mid-animation and create a flash. NativeMethods.ShowWindow(h, show ? NativeMethods.SW_SHOWNOACTIVATE : NativeMethods.SW_HIDE); } } @@ -131,8 +125,12 @@ public uint GetAppbarState() private void SetAppbarState(uint state) { + IntPtr primaryTaskbar = NativeMethods.FindWindow("Shell_TrayWnd", null); + if (primaryTaskbar == IntPtr.Zero) return; + NativeMethods.APPBARDATA data = new NativeMethods.APPBARDATA(); data.cbSize = (uint)Marshal.SizeOf(typeof(NativeMethods.APPBARDATA)); + data.hWnd = primaryTaskbar; data.lParam = new IntPtr((long)state); NativeMethods.SHAppBarMessage(NativeMethods.ABM_SETSTATE, ref data); } diff --git a/src/SlipperyContext.Diagnostics.cs b/src/SlipperyContext.Diagnostics.cs index 1081993..662670c 100644 --- a/src/SlipperyContext.Diagnostics.cs +++ b/src/SlipperyContext.Diagnostics.cs @@ -20,7 +20,7 @@ private void CopyDiagnostics() { StringBuilder b = new StringBuilder(); b.AppendLine("Slippery Taskbar C# diagnostics"); - b.AppendLine("Build: 1.0.0"); + b.AppendLine("Build: 1.0.1"); b.AppendLine("Runtime: " + Environment.Version); b.AppendLine("OS: " + Environment.OSVersion); b.AppendLine("Executable: " + Application.ExecutablePath); diff --git a/src/SlipperyTaskbar.csproj b/src/SlipperyTaskbar.csproj index 7df1bfa..e7233a2 100644 --- a/src/SlipperyTaskbar.csproj +++ b/src/SlipperyTaskbar.csproj @@ -13,8 +13,8 @@ true true false - 1.0.0 - 1.0.0.0 + 1.0.1 + 1.0.1.0 Slippery Taskbar Hide the Windows 11 taskbar until the Windows key or shell UI intentionally reveals it. diff --git a/src/TaskbarController.Core.cs b/src/TaskbarController.Core.cs index 21a84fe..97e6434 100644 --- a/src/TaskbarController.Core.cs +++ b/src/TaskbarController.Core.cs @@ -73,11 +73,6 @@ public void ApplyVisibility(bool show) { if (!NativeMethods.IsWindow(h)) continue; - // Match Buttery Taskbar's least-invasive visibility model: one - // synchronous ShowWindow call, with Explorer left in control of the - // taskbar's own auto-hide/XAML animation and position. Do not pair - // this with SetWindowPos or force the bar back onto the monitor; those - // operations can fight Explorer mid-animation and create a flash. NativeMethods.ShowWindow(h, show ? NativeMethods.SW_SHOWNOACTIVATE : NativeMethods.SW_HIDE); } } @@ -131,8 +126,12 @@ public uint GetAppbarState() private void SetAppbarState(uint state) { + IntPtr primaryTaskbar = NativeMethods.FindWindow("Shell_TrayWnd", null); + if (primaryTaskbar == IntPtr.Zero) return; + NativeMethods.APPBARDATA data = new NativeMethods.APPBARDATA(); data.cbSize = (uint)Marshal.SizeOf(typeof(NativeMethods.APPBARDATA)); + data.hWnd = primaryTaskbar; data.lParam = new IntPtr((long)state); NativeMethods.SHAppBarMessage(NativeMethods.ABM_SETSTATE, ref data); }