Skip to content

Update Island Media Controls to 0.9.88#4696

Open
usho-lear wants to merge 3 commits into
ramensoftware:mainfrom
usho-lear:update-island-media-controls-0.9.39
Open

Update Island Media Controls to 0.9.88#4696
usho-lear wants to merge 3 commits into
ramensoftware:mainfrom
usho-lear:update-island-media-controls-0.9.39

Conversation

@usho-lear

@usho-lear usho-lear commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

This updates island-media-controls to version 0.9.88.

The update focuses on Fluent Acrylic visuals, safer update behavior for existing users, startup/unload stability, browser/live-media artwork correctness, themed-taskbar compatibility, high-DPI popup fixes, and smoother media/session handling.

Changelog

Material defaults and migration

  • Changed the default background material from mica_like to acrylic.
  • Added a one-time settings migration so existing users who still have the old default mica_like material are moved to Acrylic behavior after updating.
  • Preserved user choice: if a user explicitly changes the material to solid or acrylic, the migration override stops applying.
  • Bumped the mod version to 0.9.88 so existing installations receive the update.

Acrylic popup backdrop

  • Added a native Acrylic/glass popup backdrop path backed by a separate overlay window.
  • Added WGC/D3D/D2D resources for live blurred backdrop rendering when available.
  • Added fallback blurred backdrop rendering while WGC is not ready.
  • Added handoff controls for the fallback-to-live backdrop transition.
  • Kept the compact island visually stable with a tinted brush instead of relying on XAML Acrylic fallback behavior.
  • Reduced noisy WGC diagnostics during normal unload/startup transitions.

Startup, unload, and lifecycle safety

  • Added an explicit active lifecycle flag so startup, taskbar rebuild, settings changes, media callbacks, and unload paths do not race each other.
  • Guarded taskbar-thread injection and settings application so stale callbacks cannot re-inject UI while the mod is unloading.
  • Made unload idempotent with an atomic unload transition.
  • Stopped media refreshes and queued media commands when the mod is no longer active.
  • Added timeout-based GSMTC manager requests so startup or shutdown is less likely to get stuck waiting on Windows media APIs.
  • Added safer media thread startup failure handling.
  • Continued stopping render/layout hooks during island removal and unload.

Media/session handling

  • Switched the media worker toward GSMTC event-triggered refreshes:
    • SessionsChanged
    • CurrentSessionChanged
    • MediaPropertiesChanged
    • PlaybackInfoChanged
    • TimelinePropertiesChanged
  • Kept a low-frequency fallback refresh for provider compatibility.
  • Added safer media command handling around popup seek interactions.
  • Refreshed media/session state before issuing playback commands to reduce stale-session control failures.
  • Released GSMTC objects before uninitializing the media thread WinRT apartment.

Apple Music and seeking

  • Improved seek handling for providers that report timeline offsets differently.
  • Added Apple Music UI Automation fallback seek support.
  • Restored compatibility for Apple Music progress seeking.
  • Fixed compact and popup progress seek pointer handling.
  • Smoothed compact playback progress updates.

Browser/live artwork correctness

  • Added source-app/media identity tracking for artwork.
  • Prevented stale thumbnails from being reused across different browser live sessions.
  • Limited same-media empty-thumbnail reuse to a short grace period.
  • Added a guard for repeated browser live thumbnails so suspicious old artwork is temporarily hidden instead of immediately reused.
  • Kept the default low-resolution video artwork mode as browser thumbnail/original artwork rather than generated abstract artwork.
  • Added G2-shaped popup cover generation for placeholder and real artwork.

Compact taskbar island layout

  • Added AutoSizeToTaskbar, enabled by default.
  • Introduced runtime layout calculation for compact island size, album art size, corner radius, text sizes, margins, and compact progress dimensions.
  • Improved visual taskbar-height detection by considering the injection target, root height, SystemTrayFrameGrid, TaskbarFrame, positive top/bottom margins used by Taskbar Styler themes, and Win32 taskbar window fallback.
  • Prevented auto sizing from enlarging the compact island on visually smaller themed taskbars.
  • Added live taskbar layout monitoring so switching Taskbar Styler themes can update the island without reloading the mod.
  • Improved compact text clipping after settings/theme changes by replacing a fixed-width fallback with geometry-derived fallback sizing.
  • Softened compact title/artist transition clipping by slightly extending the text clip area and adding temporary left/right edge fades during song changes.

Expanded popup

  • Fixed high-DPI scaling issues when Windows display scaling is above 100%.
  • The popup host HWND now uses physical pixels, while XAML layout calculations are converted back to popup-local DIP coordinates.
  • Fixed popup fallback source geometry to account for DPI scaling.
  • Stabilized popup transport controls:
    • Replaced StackPanel + RenderTransform with fixed local Canvas placement.
    • Switched popup transport glyphs from TextBlock to FontIcon.
    • Removed baseline/line-height compensation that caused vertical drift.
    • Reduced hover-highlight/glyph mismatch across high DPI scales.
  • Improved popup shadow, cover, panel, and progress rendering consistency.

Popup/window class and code quality

  • Avoided reusing a stale popup window class.
  • Registered/unregistered popup classes with the current mod module instance.
  • Centralized repeated "apply pending settings and inject island" logic.
  • Added clearer lifecycle guards around UI injection, media refresh, and settings changes.
  • Kept unrelated metadata unchanged except for the version bump.

Notes

  • The experimental translucent_taskbar and window_glass material options were tested but intentionally not included because the visual result was not good enough yet.
  • Acrylic is now the default material for new users, and old-default users are migrated without overriding later explicit user choices.

Test plan

  • Build in Windhawk without compiler errors.
  • Install/update the mod and verify the compact island appears.
  • Verify Acrylic is the default material for fresh settings.
  • Verify a user with the old mica_like default is migrated to Acrylic behavior after updating.
  • Verify users can still manually choose mica_like, solid, or acrylic after migration.
  • Verify Auto size to taskbar is enabled by default for fresh settings.
  • Verify compact island layout adapts to smaller and larger taskbar visual heights.
  • Switch Taskbar Styler themes and verify compact island dimensions update without reloading the mod.
  • Change Windows display scaling to 125%, 150%, and 200%:
    • expanded popup should no longer be clipped
    • popup controls should remain visible
    • play/pause glyph should align with hover/highlight region
  • Verify compact title/artist text is not clipped after changing mod settings.
  • Verify browser/live media without artwork does not reuse stale artwork from a previous session.
  • Verify regular media artwork still displays correctly.
  • Verify seek/transport controls still work in the expanded popup.
  • Reload/unload the mod and verify Windhawk does not remain stuck in uninitializing.

- Add event-driven GSMTC refresh with a 30s fallback poll
- Fix browser/live-media artwork reuse across media sessions
- Add taskbar visual-height auto sizing and live layout refresh
- Improve compact text clipping after settings/theme changes
- Fix expanded popup DPI scaling on Windows display scaling above 100%
- Stabilize expanded popup transport controls with Canvas + FontIcon layout
@m417z

m417z commented Jul 6, 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. winrt::uninit_apartment() releases the session manager after the apartment is already torn down. In MediaThreadProc, the teardown is:

    clearSessionEvents();
    try {
        if (manager) {
            manager.SessionsChanged(sessionsChangedToken);
            manager.CurrentSessionChanged(currentSessionChangedToken);
        }
    } catch (...) {
    }
    winrt::uninit_apartment();
}   // <-- `manager` is destructed *here*, after CoUninitialize

manager still holds a COM reference when winrt::uninit_apartment() (i.e. CoUninitialize) runs; its Release() then happens during stack unwind, after the apartment has been uninitialized. Releasing a WinRT/COM object after its apartment is gone is undefined — C++/WinRT specifically requires all WinRT objects to be destroyed before uninit_apartment(), and for a system-served object like the GSMTC manager this can crash or hang the media thread on unload (which, since this is explorer.exe, means the shell). The winrt::uninit_apartment() call is new in this PR, so this is a freshly introduced teardown hazard. Fix is one line — drop the reference first:

    clearSessionEvents();
    try {
        if (manager) {
            manager.SessionsChanged(sessionsChangedToken);
            manager.CurrentSessionChanged(currentSessionChangedToken);
        }
    } catch (...) {
    }
    manager = nullptr;            // release all WinRT objects before uninit
    winrt::uninit_apartment();

(sessionEventSubscriptions is already emptied by clearSessionEvents(), so manager is the only outstanding WinRT object.)

Optional improvements

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

  • Dead g_popupXamlControlsScale. Now that the transport controls are a Canvas with fixed child slots instead of a StackPanel + ScaleTransform, g_popupXamlControlsScale is only ever assigned nullptr (lines 365, 3814, 4210, 5935). The global and its if (g_popupXamlControlsScale) { ... } branch in UpdatePopupXamlVisuals() are unreachable — safe to remove both.

Functionality notes

Non-critical observations about the feature behavior itself.

  • LooksLikeBrowserMediaSource is a broad substring match. It keys on tokens like L"Opera", L"Arc", and L"Browser" inside the source AppUserModelId, which can both false-positive (a non-browser app whose AUMID happens to contain one of these) and false-negative (a Chromium browser packaged under a custom AUMID). The impact is limited — it only gates the short "hide suspicious repeated thumbnail" grace window for browser live media — so this is just an FYI that the heuristic is inherently fuzzy, not a correctness problem.

@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.39 Update Island Media Controls to 0.9.87 Jul 8, 2026
@usho-lear

Copy link
Copy Markdown
Contributor Author

Summary

This updates island-media-controls to version 0.9.87.

The update focuses on Fluent Acrylic visuals, safer update behavior for existing users, startup/unload stability, browser/live-media artwork correctness, themed-taskbar compatibility, high-DPI popup fixes, and smoother media/session handling.

Changelog

Material defaults and migration

  • Changed the default background material from mica_like to acrylic.
  • Added a one-time settings migration so existing users who still have the old default mica_like material are moved to Acrylic behavior after updating.
  • Preserved user choice: if a user explicitly changes the material to solid or acrylic, the migration override stops applying.
  • Bumped the mod version to 0.9.87 so existing installations receive the update.

Acrylic popup backdrop

  • Added a native Acrylic/glass popup backdrop path backed by a separate overlay window.
  • Added WGC/D3D/D2D resources for live blurred backdrop rendering when available.
  • Added fallback blurred backdrop rendering while WGC is not ready.
  • Added handoff controls for the fallback-to-live backdrop transition.
  • Kept the compact island visually stable with a tinted brush instead of relying on XAML Acrylic fallback behavior.
  • Reduced noisy WGC diagnostics during normal unload/startup transitions.

Startup, unload, and lifecycle safety

  • Added an explicit active lifecycle flag so startup, taskbar rebuild, settings changes, media callbacks, and unload paths do not race each other.
  • Guarded taskbar-thread injection and settings application so stale callbacks cannot re-inject UI while the mod is unloading.
  • Made unload idempotent with an atomic unload transition.
  • Stopped media refreshes and queued media commands when the mod is no longer active.
  • Added timeout-based GSMTC manager requests so startup or shutdown is less likely to get stuck waiting on Windows media APIs.
  • Added safer media thread startup failure handling.
  • Continued stopping render/layout hooks during island removal and unload.

Media/session handling

  • Switched the media worker toward GSMTC event-triggered refreshes:
    • SessionsChanged
    • CurrentSessionChanged
    • MediaPropertiesChanged
    • PlaybackInfoChanged
    • TimelinePropertiesChanged
  • Kept a low-frequency fallback refresh for provider compatibility.
  • Added safer media command handling around popup seek interactions.
  • Refreshed media/session state before issuing playback commands to reduce stale-session control failures.
  • Released GSMTC objects before uninitializing the media thread WinRT apartment.

Apple Music and seeking

  • Improved seek handling for providers that report timeline offsets differently.
  • Added Apple Music UI Automation fallback seek support.
  • Restored compatibility for Apple Music progress seeking.
  • Fixed compact and popup progress seek pointer handling.
  • Smoothed compact playback progress updates.

Browser/live artwork correctness

  • Added source-app/media identity tracking for artwork.
  • Prevented stale thumbnails from being reused across different browser live sessions.
  • Limited same-media empty-thumbnail reuse to a short grace period.
  • Added a guard for repeated browser live thumbnails so suspicious old artwork is temporarily hidden instead of immediately reused.
  • Kept the default low-resolution video artwork mode as browser thumbnail/original artwork rather than generated abstract artwork.
  • Added G2-shaped popup cover generation for placeholder and real artwork.

Compact taskbar island layout

  • Added AutoSizeToTaskbar, enabled by default.
  • Introduced runtime layout calculation for compact island size, album art size, corner radius, text sizes, margins, and compact progress dimensions.
  • Improved visual taskbar-height detection by considering the injection target, root height, SystemTrayFrameGrid, TaskbarFrame, positive top/bottom margins used by Taskbar Styler themes, and Win32 taskbar window fallback.
  • Prevented auto sizing from enlarging the compact island on visually smaller themed taskbars.
  • Added live taskbar layout monitoring so switching Taskbar Styler themes can update the island without reloading the mod.
  • Improved compact text clipping after settings/theme changes by replacing a fixed-width fallback with geometry-derived fallback sizing.

Expanded popup

  • Fixed high-DPI scaling issues when Windows display scaling is above 100%.
  • The popup host HWND now uses physical pixels, while XAML layout calculations are converted back to popup-local DIP coordinates.
  • Fixed popup fallback source geometry to account for DPI scaling.
  • Stabilized popup transport controls:
    • Replaced StackPanel + RenderTransform with fixed local Canvas placement.
    • Switched popup transport glyphs from TextBlock to FontIcon.
    • Removed baseline/line-height compensation that caused vertical drift.
    • Reduced hover-highlight/glyph mismatch across high DPI scales.
  • Improved popup shadow, cover, panel, and progress rendering consistency.

Popup/window class and code quality

  • Avoided reusing a stale popup window class.
  • Registered/unregistered popup classes with the current mod module instance.
  • Centralized repeated "apply pending settings and inject island" logic.
  • Added clearer lifecycle guards around UI injection, media refresh, and settings changes.
  • Kept unrelated metadata unchanged except for the version bump.

Notes

  • The experimental translucent_taskbar and window_glass material options were tested but intentionally not included because the visual result was not good enough yet.
  • Acrylic is now the default material for new users, and old-default users are migrated without overriding later explicit user choices.

Test plan

  • Build in Windhawk without compiler errors.
  • Install/update the mod and verify the compact island appears.
  • Verify Acrylic is the default material for fresh settings.
  • Verify a user with the old mica_like default is migrated to Acrylic behavior after updating.
  • Verify users can still manually choose mica_like, solid, or acrylic after migration.
  • Verify Auto size to taskbar is enabled by default for fresh settings.
  • Verify compact island layout adapts to smaller and larger taskbar visual heights.
  • Switch Taskbar Styler themes and verify compact island dimensions update without reloading the mod.
  • Change Windows display scaling to 125%, 150%, and 200%:
    • expanded popup should no longer be clipped
    • popup controls should remain visible
    • play/pause glyph should align with hover/highlight region
  • Verify compact title/artist text is not clipped after changing mod settings.
  • Verify browser/live media without artwork does not reuse stale artwork from a previous session.
  • Verify regular media artwork still displays correctly.
  • Verify seek/transport controls still work in the expanded popup.
  • Reload/unload the mod and verify Windhawk does not remain stuck in uninitializing.

@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.87 Update Island Media Controls to 0.9.88 Jul 8, 2026
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