Add Vertical OmniButton mod#3859
Conversation
Updated mod description and version for Windows 10 and 11 compatibility. Added Windows version enumeration and improved taskbar handling for both Windows versions.
Rearranges the Windows 11 system tray OmniButton (wifi/volume/battery) from horizontal to vertical stacking using the Windows XAML Diagnostics API.
- Remove clock layout feature (moved to style.yaml) - Remove auxiliary settings (restartExplorer, enableVertical, debugLogging, dumpOmniTree, openBatterySettings) - Simplify Wh_ModSettingsChanged to use CleanupXamlElements + re-traverse - Add defaults note to Battery percentage description - Update readme to remove stale setting references Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add // Taskbar.View.dll and // taskbar.dll comments above each WindhawkUtils::SYMBOL_HOOK hooks[] declaration as required by ramensoftware/windhawk-mods PR validation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
offWifiX/Y, offVolumeX/Y, offBatteryX/Y inlineWifiX/Y, inlineVolumeX/Y, inlineBatteryX/Y, inlinePercentX/Y stackedWifiX/Y, stackedVolumeX/Y, stackedBatteryX/Y, stackedPercentX/Y Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Background thread retries ApplyAllSettings up to 5 times (2s apart) after mod init, covering the race where the XAML tree isn't ready when explorer first loads the mod on startup.
- Remove registry writes entirely; mod never touches TaskbarBatteryPercent - Off mode now hides % text via XAML offset instead of registry, so all three modes switch live with no explorer restart required - Add per-mode offsets for the hidden % text in Off mode (offPercentX/Y) - Fix Off mode: stop flipping inner StackPanel orientation (was breaking glyph rendering); only push the text element off-screen with a transform - Remove dead RestoreOmniButtonHeight function - Fix deferred (LayoutUpdated) path for Off mode battery slot offset - Sync battery % language across embedded readme, YAML, and README Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
This version should be much more agreeable. |
|
I see that the code is similar to #3932 which I reviewed. Please apply my comments here too, let me know when it's ready for review. |
Addresses review comments: - GetSystemTrayModuleHandle(): tries SystemTray.dll (Win11 26200+), falls back to Taskbar.View.dll (skipped at version >=2604), then ExplorerExtensions.dll - GetTaskbarXamlRoot: add #elif _M_ARM64 / #else #error arms - Add -lversion; use WindhawkUtils::Wh_SetFunctionHookT Also adds buttonHorizontalPadding setting, stoppable retry thread, and inline mode auto-sizing so hover highlight matches content exactly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Updated to v1.4 with the review comments applied (same changes as #3932):
Also included since the last review:
|
| // Use default offset. | ||
| #else | ||
| #error "Unsupported architecture" | ||
| #endif |
There was a problem hiding this comment.
Please use the same code as can be found here:
https://github.com/m417z/my-windhawk-mods/blob/e1261d85c2f42006b0dc355fbbc3a8d71a078585/mods/taskbar-multirow.wh.cpp#L261-L291
In this mod and your other mod.
| if (WaitForSingleObject(stopEvent, 2000) != WAIT_TIMEOUT) break; | ||
| if (g_omniStackPanel || g_unloading) break; | ||
| Wh_Log(L"[AfterInit] Retry %d — XAML not yet applied", i + 1); | ||
| ApplyAllSettingsOnWindowThread(); |
There was a problem hiding this comment.
The mod already hooks IconView::IconView, so why is this thread needed?
|
|
||
| static void FlipBatteryLayout(FrameworkElement const& batteryCP) { | ||
| if (!WalkBatteryTree(batteryCP, 0)) | ||
| Wh_Log(L"[Battery4] No inner StackPanel found (% may not be in tree yet)"); |
| with the Windows 11 Taskbar Styler out of the box — no special settings required. | ||
|
|
||
| For basic vertical stacking without battery percentage, paste [style.yaml](https://github.com/sb4ssman/Windhawk-Vertical-OmniButton/blob/main/style.yaml) | ||
| into Windows 11 Taskbar Styler → Settings → Advanced. |
There was a problem hiding this comment.
| into Windows 11 Taskbar Styler → Settings → Advanced. | |
| into Windows 11 Taskbar Styler → Settings → Textual mode. |
|
|
||
| iconView.Loaded([](IInspectable const&, RoutedEventArgs const&) { | ||
| if (!g_unloading && !g_omniStackPanel) | ||
| ApplyAllSettings(); |
There was a problem hiding this comment.
Unsubscribe after handling, otherwise the callback might be called again when the mod is unloaded, causing a crash. There's an example below, but if you prefer something simpler, allocate memory for the revoke token, assign it from iconView.Loaded, pass the pointer to the lambda, and unsubscribe when it's called.
windhawk-mods/mods/taskbar-tray-system-icon-tweaks.wh.cpp
Lines 1321 to 1331 in a5fb564
|
@m417z Vertical-omnibutton was the first pass at this; in the interim I built a more comprehensive replacement (omnibutton-customizer) that covers vertical as one configuration of a full grid layout, adds per-element nudging, item reordering, and fill-order control among other details. I'd like to close this PR and submit omnibutton-customizer instead as the single OmniButton mod. Do you have any concerns with that, may I just close it and submit? |
|
No concerns, go ahead. Alternatively, you can update this PR, whatever you prefer. |
Adds the Vertical OmniButton mod — stacks the Windows 11 system tray OmniButton (wifi / volume / battery) vertically using
Taskbar.View.dllsymbol hooks andGetTaskbarXamlRoot.What's in v1.2
Simplified and cleaned up from the initial submission:
TaskbarBatteryPercent. All three battery percentage modes (Off / Inline / Stacked) switch live with no explorer restart.TranslateTransformoffset rather than toggling a registry value. Users keep battery percentage enabled in Windows; Off mode simply nudges the text off-screen.offPercentX/offPercentYlet users tune exactly how far off-screen the hidden text is pushed (useful for non-standard themes where it might bleed in).LayoutUpdated) code path to apply the battery slot position offset in Off mode.RestoreOmniButtonHeightfunction.