diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 3a3387f..364be1a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -24,11 +24,11 @@ jobs: go-version: '1.23.x' cache: false - - name: Compile C# app + - name: Compile C# source shell: cmd run: src\build-framework.cmd - - name: Build setup and checksums + - name: Build setup and checksum shell: pwsh run: | $version = (Get-Content VERSION -Raw).Trim() @@ -42,20 +42,15 @@ jobs: python .\add_setup_icon.py .\SlipperyTaskbar-Setup.raw.exe .\payload\slippery-taskbar.ico "..\SlipperyTaskbar-Setup-v$version.exe" Pop-Location - Copy-Item .\src\SlipperyTaskbar.exe .\SlipperyTaskbar.exe - $files = @('SlipperyTaskbar.exe', "SlipperyTaskbar-Setup-v$version.exe") - $lines = foreach ($file in $files) { - $hash = (Get-FileHash $file -Algorithm SHA256).Hash.ToLowerInvariant() - "$hash $file" - } - Set-Content -Path SHA256SUMS.txt -Value $lines -Encoding ascii + $file = "SlipperyTaskbar-Setup-v$version.exe" + $hash = (Get-FileHash $file -Algorithm SHA256).Hash.ToLowerInvariant() + Set-Content -Path SHA256SUMS.txt -Value "$hash $file" -Encoding ascii - name: Upload Actions artifact uses: actions/upload-artifact@v4 with: name: Slippery-Taskbar-x64 path: | - SlipperyTaskbar.exe SlipperyTaskbar-Setup-v*.exe SHA256SUMS.txt if-no-files-found: error @@ -75,7 +70,6 @@ jobs: } gh release create $tag ` - SlipperyTaskbar.exe ` "SlipperyTaskbar-Setup-v$version.exe" ` SHA256SUMS.txt ` --repo "${{ github.repository }}" ` diff --git a/README.md b/README.md index 9974536..5936842 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,5 @@ # Slippery Taskbar -Hides the Windows 11 taskbar until you press the Windows key. +Hide the Windows 11 taskbar until you press **Win**. Download from **Releases**. -Download from **Releases**. - -Build from source with `src\build-framework.cmd` or `src\publish-net8.ps1`. +Source is in `src/`; build with `src\build-framework.cmd` or `src\publish-net8.ps1`. diff --git a/VERSION b/VERSION index 9e11b32..3eefcb9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +1.0.0 diff --git a/assets/slippery-taskbar.ico b/assets/slippery-taskbar.ico index 8dccc82..c02dac3 100644 Binary files a/assets/slippery-taskbar.ico and b/assets/slippery-taskbar.ico differ diff --git a/bootstrap/main.go b/bootstrap/main.go index 8b9234e..06a5f27 100644 --- a/bootstrap/main.go +++ b/bootstrap/main.go @@ -127,7 +127,6 @@ func main() { "/optimize+", "/platform:x64", "/out:" + nextExe, - "/win32icon:" + iconPath, "/reference:System.dll", "/reference:System.Core.dll", "/reference:System.Drawing.dll", diff --git a/bootstrap/payload/SlipperyContext.Core.cs b/bootstrap/payload/SlipperyContext.Core.cs index 9a61254..fdcb80d 100644 --- a/bootstrap/payload/SlipperyContext.Core.cs +++ b/bootstrap/payload/SlipperyContext.Core.cs @@ -67,10 +67,6 @@ public SlipperyContext() NativeMethods.MOD_CONTROL | NativeMethods.MOD_WIN | NativeMethods.MOD_NOREPEAT, NativeMethods.VK_F11); - // Observe notification-area pointer activity before Explorer processes it. - // Native auto-hide remains enabled and stable for the entire enabled - // session; this hook only starts a short visibility guard so Explorer - // cannot slide the bar away underneath the hidden-icons flyout. _mouseHookProc = MouseHookCallback; _mouseHook = NativeMethods.InstallLowLevelMouseHook(_mouseHookProc); @@ -88,10 +84,7 @@ public SlipperyContext() _menu.ItemClicked += OnMenuItemClicked; _menu.Closed += OnMenuClosed; - Icon appIcon = null; - try { appIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } - catch { } - if (appIcon == null) appIcon = SystemIcons.Application; + Icon appIcon = LoadAppIcon(); _notifyIcon = new NotifyIcon(); _notifyIcon.Icon = appIcon; @@ -113,6 +106,35 @@ public SlipperyContext() _timer.Start(); } + private static Icon LoadAppIcon() + { + string exeDir = Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty; + string[] candidates = new string[] + { + Path.Combine(exeDir, "managed-source", "slippery-taskbar.ico"), + Path.Combine(exeDir, "slippery-taskbar.ico"), + Path.GetFullPath(Path.Combine(exeDir, "..", "assets", "slippery-taskbar.ico")) + }; + + foreach (string candidate in candidates) + { + try + { + if (File.Exists(candidate)) return new Icon(candidate); + } + catch { } + } + + try + { + Icon associated = Icon.ExtractAssociatedIcon(Application.ExecutablePath); + if (associated != null) return associated; + } + catch { } + + return SystemIcons.Application; + } + private ToolStripMenuItem AddMenuItem(string text, TrayCommand command) { ToolStripMenuItem item = new ToolStripMenuItem(text); @@ -151,9 +173,6 @@ private void OnMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) _pendingCommand = TrayCommand.None; if (command != TrayCommand.None) { - // Run after WinForms has completely unwound ContextMenuStrip's - // nested popup loop. This avoids the stale-focus/menu bug from - // the earlier raw Shell_NotifyIcon implementation. _window.BeginInvoke((MethodInvoker)delegate { ExecuteCommand(command); }); } } @@ -219,6 +238,5 @@ private void SavePreferences() prefs.StartWithWindows = _startWithWindows; _preferencesStore.Save(prefs); } - } } diff --git a/src/SlipperyContext.Core.cs b/src/SlipperyContext.Core.cs index 9a61254..fdcb80d 100644 --- a/src/SlipperyContext.Core.cs +++ b/src/SlipperyContext.Core.cs @@ -67,10 +67,6 @@ public SlipperyContext() NativeMethods.MOD_CONTROL | NativeMethods.MOD_WIN | NativeMethods.MOD_NOREPEAT, NativeMethods.VK_F11); - // Observe notification-area pointer activity before Explorer processes it. - // Native auto-hide remains enabled and stable for the entire enabled - // session; this hook only starts a short visibility guard so Explorer - // cannot slide the bar away underneath the hidden-icons flyout. _mouseHookProc = MouseHookCallback; _mouseHook = NativeMethods.InstallLowLevelMouseHook(_mouseHookProc); @@ -88,10 +84,7 @@ public SlipperyContext() _menu.ItemClicked += OnMenuItemClicked; _menu.Closed += OnMenuClosed; - Icon appIcon = null; - try { appIcon = Icon.ExtractAssociatedIcon(Application.ExecutablePath); } - catch { } - if (appIcon == null) appIcon = SystemIcons.Application; + Icon appIcon = LoadAppIcon(); _notifyIcon = new NotifyIcon(); _notifyIcon.Icon = appIcon; @@ -113,6 +106,35 @@ public SlipperyContext() _timer.Start(); } + private static Icon LoadAppIcon() + { + string exeDir = Path.GetDirectoryName(Application.ExecutablePath) ?? string.Empty; + string[] candidates = new string[] + { + Path.Combine(exeDir, "managed-source", "slippery-taskbar.ico"), + Path.Combine(exeDir, "slippery-taskbar.ico"), + Path.GetFullPath(Path.Combine(exeDir, "..", "assets", "slippery-taskbar.ico")) + }; + + foreach (string candidate in candidates) + { + try + { + if (File.Exists(candidate)) return new Icon(candidate); + } + catch { } + } + + try + { + Icon associated = Icon.ExtractAssociatedIcon(Application.ExecutablePath); + if (associated != null) return associated; + } + catch { } + + return SystemIcons.Application; + } + private ToolStripMenuItem AddMenuItem(string text, TrayCommand command) { ToolStripMenuItem item = new ToolStripMenuItem(text); @@ -151,9 +173,6 @@ private void OnMenuClosed(object sender, ToolStripDropDownClosedEventArgs e) _pendingCommand = TrayCommand.None; if (command != TrayCommand.None) { - // Run after WinForms has completely unwound ContextMenuStrip's - // nested popup loop. This avoids the stale-focus/menu bug from - // the earlier raw Shell_NotifyIcon implementation. _window.BeginInvoke((MethodInvoker)delegate { ExecuteCommand(command); }); } } @@ -219,6 +238,5 @@ private void SavePreferences() prefs.StartWithWindows = _startWithWindows; _preferencesStore.Save(prefs); } - } } diff --git a/src/SlipperyTaskbar.csproj b/src/SlipperyTaskbar.csproj index a263f03..7df1bfa 100644 --- a/src/SlipperyTaskbar.csproj +++ b/src/SlipperyTaskbar.csproj @@ -7,7 +7,6 @@ disable SlipperyTaskbar SlipperyTaskbar - ..\assets\slippery-taskbar.ico x64 win-x64 true diff --git a/src/build-framework.cmd b/src/build-framework.cmd index 5261eb2..1fcac07 100644 --- a/src/build-framework.cmd +++ b/src/build-framework.cmd @@ -10,7 +10,6 @@ if not exist "%CSC%" ( "%CSC%" /nologo /target:winexe /optimize+ /platform:x64 ^ /out:"%ROOT%SlipperyTaskbar.exe" ^ - /win32icon:"%ROOT%..\assets\slippery-taskbar.ico" ^ /reference:System.dll /reference:System.Core.dll /reference:System.Drawing.dll ^ /reference:System.Windows.Forms.dll /reference:System.Runtime.Serialization.dll ^ "%ROOT%Program.cs" "%ROOT%SlipperyContext.Core.cs" "%ROOT%SlipperyContext.Polling.cs" ^