Skip to content

[Feature] Add taskbar widget overlap prevention feature#718

Open
koiseka wants to merge 1 commit intounchihugo:masterfrom
koiseka:master
Open

[Feature] Add taskbar widget overlap prevention feature#718
koiseka wants to merge 1 commit intounchihugo:masterfrom
koiseka:master

Conversation

@koiseka
Copy link
Copy Markdown

@koiseka koiseka commented Apr 26, 2026

Summary

This PR introduces an optional overlap-prevention feature for the Taskbar Widget in left alignment mode.
When enabled, FluentFlyout detects available space before the Start button and shrinks widget width as needed to avoid overlap in constrained taskbar layouts.

Motivation

On small taskbars or when many apps are pinned or running, the left-aligned taskbar widget can overlap with Start-area UI.
This change improves layout reliability and user control by adding a dedicated setting to prevent overlap only when needed.

Partially addresses #447 by reducing taskbar widget overlap in constrained layouts via optional Start-boundary-aware width clamping.

Type of Change

  • Feature
  • Bug fix
  • Refactor (no functional changes)
  • Style (formatting, naming)
  • Other

What Changed

  • Added a new user setting: TaskbarWidgetPreventStartOverlap (default: off).
  • Added a new toggle in Taskbar Widget settings UI for overlap prevention (left alignment only).
  • Implemented Start-button-aware overlap prevention in taskbar widget positioning.
  • Resolves Start button bounds using UI Automation.
  • Validates Start bounds before applying clamping to avoid false-positive matches.
  • Shrinks widget width only when overlap would occur.
  • Preserves existing placement behavior when overlap prevention is disabled or Start bounds are unavailable.
  • Extended taskbar element lookup helper to support property-based lookups for safer Start detection.
  • Added English localization strings for the new setting.

Additional Information

All screenshots were captured on the same monitor/taskbar scale for direct comparison.

Before (Windows Widgets disabled)
overlap-before-no-widgets

After enabling overlap prevention (Windows Widgets disabled)
overlap-after-no-widgets

Before (Windows Widgets enabled)
overlap-before-with-widgets

After enabling overlap prevention (Windows Widgets enabled)
overlap-after-with-widgets

Checklist

  • Code changes are manually tested and working.
  • Formatting and naming are consistent with the project.
  • Self-review of changes is done.
  • AI tools were used (if yes, I reviewed and fully understand the changes myself).

Co-authored-by: Copilot <copilot@github.com>
@github-actions github-actions Bot added TaskbarWindow Changes to TaskbarWindow; the container for taskbar widgets Taskbar Widget Changes to the Taskbar Media Widget labels Apr 26, 2026
@Trollcraft1002
Copy link
Copy Markdown

Hello, I tested the PR build locally.

The overlap prevention seems to work for the main music/taskbar widget, but it does not appear to work for the taskbar visualizer / volume visualizer area.

In the first screenshot, the media widget is positioned correctly and does not overlap the pinned taskbar icons:

image

In the second screenshot, however, the visualizer still overlaps the pinned taskbar icons and blocks interaction with them:

image

For now the solution is to use Bottom Left option on the "Visualizer Position Relative to Taskbar Widget"

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

Labels

Taskbar Widget Changes to the Taskbar Media Widget TaskbarWindow Changes to TaskbarWindow; the container for taskbar widgets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants