Skip to content

Prevent widget overlap with taskbar apps#57

Closed
vladimirgamalyan wants to merge 1 commit into
CodeZeno:mainfrom
vladimirgamalyan:agent/prevent-taskbar-overlap
Closed

Prevent widget overlap with taskbar apps#57
vladimirgamalyan wants to merge 1 commit into
CodeZeno:mainfrom
vladimirgamalyan:agent/prevent-taskbar-overlap

Conversation

@vladimirgamalyan

Copy link
Copy Markdown

What changed

  • detect the Windows task-switcher bounds (MSTaskListWClass, MSTaskSwWClass, or ReBarWindow32)
  • clamp restored and dragged widget offsets so the widget cannot enter the task-button region
  • reuse the existing WinEvent hook to react when the task-switcher layout changes
  • temporarily hide the widget when the gap before the notification area is too narrow, then show it again automatically when space returns
  • keep the tray icon and the user's visibility preference unchanged while space is unavailable

Why

The widget was positioned relative to the taskbar and notification area only. Its maximum offset used the taskbar's left edge, so a restored position or drag could place it on top of pinned and running app buttons. The same overlap could appear later as the task list expanded.

This is a focused overlap safeguard. It complements the broader snap-and-resize work proposed in #17 without introducing a new placement UI.

Impact

Taskbar buttons remain accessible. Existing saved positions are preserved when they are safe and clamped when they are not. If no non-overlapping region can fit the widget, users can still access the monitor through its tray icon until taskbar space becomes available.

Validation

  • cargo test (9 passed)
  • cargo build --release
  • cargo clippy --all-targets --no-deps -- -D warnings with allowances for the repository's existing lint findings
  • live Windows 11 Pro build 26200 check: task switcher (45, 1392, 865, 1440), widget (1891, 1394, 2176, 1440), notification area (2343, 1392, 2560, 1440)

@vladimirgamalyan
vladimirgamalyan deleted the agent/prevent-taskbar-overlap branch July 12, 2026 04:22
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.

1 participant