Skip to content
Merged
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
16 changes: 5 additions & 11 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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
Expand All @@ -75,7 +70,6 @@ jobs:
}

gh release create $tag `
SlipperyTaskbar.exe `
"SlipperyTaskbar-Setup-v$version.exe" `
SHA256SUMS.txt `
--repo "${{ github.repository }}" `
Expand Down
6 changes: 2 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -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`.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.1
1.0.0
Binary file modified assets/slippery-taskbar.ico
Binary file not shown.
1 change: 0 additions & 1 deletion bootstrap/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,6 @@ func main() {
"/optimize+",
"/platform:x64",
"/out:" + nextExe,
"/win32icon:" + iconPath,
"/reference:System.dll",
"/reference:System.Core.dll",
"/reference:System.Drawing.dll",
Expand Down
42 changes: 30 additions & 12 deletions bootstrap/payload/SlipperyContext.Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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); });
}
}
Expand Down Expand Up @@ -219,6 +238,5 @@ private void SavePreferences()
prefs.StartWithWindows = _startWithWindows;
_preferencesStore.Save(prefs);
}

}
}
42 changes: 30 additions & 12 deletions src/SlipperyContext.Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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;
Expand All @@ -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);
Expand Down Expand Up @@ -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); });
}
}
Expand Down Expand Up @@ -219,6 +238,5 @@ private void SavePreferences()
prefs.StartWithWindows = _startWithWindows;
_preferencesStore.Save(prefs);
}

}
}
1 change: 0 additions & 1 deletion src/SlipperyTaskbar.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
<ImplicitUsings>disable</ImplicitUsings>
<AssemblyName>SlipperyTaskbar</AssemblyName>
<RootNamespace>SlipperyTaskbar</RootNamespace>
<ApplicationIcon>..\assets\slippery-taskbar.ico</ApplicationIcon>
<PlatformTarget>x64</PlatformTarget>
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<SelfContained>true</SelfContained>
Expand Down
1 change: 0 additions & 1 deletion src/build-framework.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -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" ^
Expand Down
Loading