Skip to content

Add Taskbar Hide Top Border Stroke#4510

Open
nayanct wants to merge 1 commit into
ramensoftware:mainfrom
nayanct:add-taskbar-hide-top-border-stroke
Open

Add Taskbar Hide Top Border Stroke#4510
nayanct wants to merge 1 commit into
ramensoftware:mainfrom
nayanct:add-taskbar-hide-top-border-stroke

Conversation

@nayanct

@nayanct nayanct commented Jun 20, 2026

Copy link
Copy Markdown

Adds a Windhawk mod that removes the thin top border/stroke above the Windows 11 taskbar by hiding the taskbar XAML BackgroundStroke element.

Tested on:

  • Windows version: 11
  • Windhawk version: v1.7.3

Notes:

  • Targets explorer.exe.
  • Windows 11 only.
  • Uses XAML diagnostics, so it may conflict with other mods that also use XAML diagnostics.

@m417z

m417z commented Jun 22, 2026

Copy link
Copy Markdown
Member

Submission review

Note: This review was done by Claude, and then refined manually. Due to the amount of submissions, doing a fully manual review for each pull request is no longer feasible. Thank you for understanding.

Please address the following issues. The items in the collapsed sections are optional, so it's your call whether to address them.


1. This duplicates a single built-in capability of Windows 11 Taskbar Styler, and is mutually exclusive with it. Hiding BackgroundStroke is already a one-line styler rule — the styler ships exactly this target in many of its built-in themes, e.g. Rectangle#BackgroundStroke -> Visibility=Collapsed (windows-11-taskbar-styler.wh.cpp#L549). So a user can already get this effect by adding one entry to the styler. Worse, as your README notes, only one XAML-diagnostics consumer can run per process, so this mod and the styler can't both be enabled — meaning anyone who uses the styler (by far the most common way to tweak the Win11 taskbar) cannot use this mod, and anyone who enables this mod loses the styler. The Windhawk project strongly prefers extending/using an existing mod over shipping a near-duplicate that fragments the catalog. Given the effect is a single existing styler target and the two are incompatible, please reconsider whether a separate mod is warranted versus documenting the one-line styler rule — or spell out what this adds over it. (Ultimately the maintainer's call.)

2. The effect isn't reversed when the mod is disabled. Wh_ModUninit only unadvises the watcher and drops g_visualTreeWatcher; it never restores the BackgroundStroke element it collapsed. So after disabling the mod the line stays hidden until the taskbar XAML is rebuilt (explorer restart, sign-out, etc.). A core Windhawk principle is that a mod's effect disappears when it's disabled. Track the element(s) you collapse (e.g. a winrt::weak_ref<wux::FrameworkElement>) and restore Visibility::Visible on the taskbar UI thread in Wh_ModUninit via your existing RunFromWindowThread. Both reference mods do this: the styler restores captured values on teardown (UninitializeForCurrentThread), and taskbar-on-top flips its change back when g_unloading is set (taskbar-on-top.wh.cpp#L897).

Optional improvements

Minor polish — none of this affects users, so it's your call.

  • Dead g_inInjectWindhawkTAP. It's set/cleared around the injection loop but never read, because (unlike the styler) you don't hook InitializeXamlDiagnosticsEx. Since it has no effect here, drop the variable and the two assignments.

  • Match the element type, not just the name. OnVisualTreeChange collapses any FrameworkElement whose Name() is "BackgroundStroke". The styler scopes this to Rectangle#BackgroundStroke (type and name). Checking the type too (or element.Type) avoids accidentally collapsing an unrelated element that happens to share the name on the taskbar thread.

  • Add a screenshot to the README. The effect is a thin top line, which is subtle in a plain screenshot — a before/after (ideally zoomed/annotated) makes it clear. Only i.imgur.com and raw.githubusercontent.com are allowed image hosts.

Functionality notes

Non-critical observations about behavior and integration.

  • The README's "this won't attach" wording is a bit off. The styler hooks InitializeXamlDiagnosticsEx and its default xamlDiagnosticsHandling is alert (line 507). So with the styler enabled, enabling this mod will, by default, pop up the styler's "a module is trying to use XAML diagnostics — block it?" prompt rather than silently failing; if the user allows it, your TAP attaches but can then displace the styler's watcher. Worth reflecting that the interaction is a prompt/conflict, not a clean no-op.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants