Skip to content

Update taskbar-scroll-actions.wh.cpp - #71

Open
iMAboud wants to merge 2 commits into
m417z:mainfrom
iMAboud:main
Open

Update taskbar-scroll-actions.wh.cpp#71
iMAboud wants to merge 2 commits into
m417z:mainfrom
iMAboud:main

Conversation

@iMAboud

@iMAboud iMAboud commented Jun 23, 2026

Copy link
Copy Markdown

Features:

  • Software Dimming: Smoothly lowers brightness below the monitor's minimum hardware limits using software layers.
  • Brightness OSD: Added a transparent, modern OSD that displays the current brightness percentage whenever it's adjusted.
  • Fallback Support: Automatically falls back to software dimming if hardware brightness (DDC/CI or WMI) is unavailable.
  • Configurable Settings: Both the software dimming feature and the OSD delay can be configured or toggled via settings.

Details:

Software Dimming Engine: Added threaded software dimming functionality (SetSoftwareDimBrightness) that intercepts AdjustBrightnessDdcCi. It tracks combined brightness states per physical monitor, clamping to minimum hardware levels (e.g., 0 DDC/CI) while scaling software overlays seamlessly down to -100.

WMI Fallback: Added graceful software dimming fallback logic in AdjustBrightnessThread when native hardware brightness is unavailable.

Brightness OSD: Implemented BrightnessOsdWndProc to draw a layered (WS_EX_LAYERED), transparent, un-activated window that renders text via GDI (DrawText). The OSD automatically hides via a configurable timer (BrightnessOsdTimerProc).
Thread Management: Instantiated and safely managed a new thread g_pSwDimThread in Wh_ModInit and Wh_ModUninit to handle software dimming message loops without blocking the main UI.

Settings Added: Exposed softwareDimming, brightnessOsd, and brightnessOsdDelay (default: 1500ms) to global settings.

@iMAboud

iMAboud commented Jun 23, 2026

Copy link
Copy Markdown
Author

Pushed an updated version to the previous update:

Features:

  • Multi-Tray Compatibility: Improved the detection of the notification area to seamlessly support third-party multi-tray mods on secondary monitors.

  • Modifier Key Requirement: Added an optional setting to require holding a specific modifier key (Ctrl, Shift, Alt, Win) to trigger scrolling actions.

  • Monitor Selection: Added an option to assign specific scrolling actions exclusively to particular monitors (e.g., Primary only, Secondary only, or All).

Details:

Multi-Tray Bridge Union: Updated GetNotificationAreaRect to dynamically loop through all DesktopWindowContentBridge instances on secondary taskbars and compute their bounding union (UnionRect). This creates a single bounding box that correctly encompasses both the native clock and the extra multi-tray icons. The layout fallback calculation was also expanded from 50 to 150 pixels for broader compatibility.

Scroll Event Filtering: Integrated GetAsyncKeyState inside OnMouseWheel to evaluate the active state of configured modifier keys (VK_CONTROL, VK_SHIFT, VK_MENU, VK_LWIN) before executing any scroll commands, bypassing the action if the requirement isn't met.

Monitor Index Enumeration: Implemented a new GetMonitorIndexForMonitor helper utilizing EnumDisplayMonitors to map physical HMONITOR handles to user-configurable numerical indices. This allows OnMouseWheel to accurately restrict scroll events to the specific monitor index configured in the settings array.

@m417z

m417z commented Jul 2, 2026

Copy link
Copy Markdown
Owner

The scope of the changes is larger than I initially thought. After considering it, I decided that it'd be better to have it submitted as a separate PR. Please update and reopen ramensoftware/windhawk-mods#4523 and I'll review it.

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