Skip to content

Update Island Media Controls to 0.9.211#4810

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

Update Island Media Controls to 0.9.211#4810
usho-lear wants to merge 7 commits into
ramensoftware:mainfrom
usho-lear:update-island-media-controls-0.9.196

Conversation

@usho-lear

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

Copy link
Copy Markdown
Contributor

Changelog

  • Update Island Media Controls to 0.9.211.
  • Add a compact expanded layout that places the album cover beside the title and artist, reducing pointer travel to the playback controls.
  • Add taskbar-position awareness, including support for Taskbar on top for Windows 11: the popup direction, component layout, and album wash adapt to the taskbar position.
  • Refine expand and collapse animations so the compact island, artwork, progress bar, playback controls, text, corner radius, and live backdrop morph more cohesively.
  • Restore display-refresh-rate-synchronized live blur without the temporary 60 FPS animation cap or 15 FPS settled-state cap.
  • Optimize Acrylic and Liquid Glass with WGC dirty-region rendering, Direct2D effect-graph composition, cached GPU resources, and fewer full-size intermediate render passes.
  • Serialize WGC frame rendering, DirectComposition updates, and live-blur render snapshots under the overlay mutex to avoid free-threaded capture races with UI-thread animation and settings updates.
  • Improve Acrylic and Liquid Glass interaction stability, reducing flicker, self-sampling, invisible overlay hit-test issues, and repeated-toggle stalls.
  • Refine the Liquid Glass edge refraction and strengthen the light-mode backdrop and playback-control tint for clearer surface shape.
  • Increase the playback-control album-wash layer opacity so the control card reads as more strongly blurred.
  • Improve light-mode visibility by keeping the album-art wash enabled for Liquid Glass.
  • Remove obsolete CPU WGC presentation, native-blur handoff, diagnostic, and unused animation helper paths while preserving the recording-mode static blur fallback.
  • Update the default settings to the currently tuned setup while keeping browser thumbnails as the default artwork mode.
  • Refresh the README and What's new sections to focus on user-facing features.
  • Use SetWindowSubclass/RemoveWindowSubclass for safe popup XAML child cleanup.

Validation

  • Windhawk Clang syntax compilation passes with -Wunreachable-code and -Wunreachable-code-aggressive.
  • python .github/pr_validation.py ./mods/island-media-controls.wh.cpp usho-lear passes.
  • git diff --check -- mods/island-media-controls.wh.cpp passes.

@usho-lear usho-lear changed the title 更新模组到 0.9.196 Update Island Media Controls to 0.9.196 Jul 16, 2026
@usho-lear
usho-lear marked this pull request as ready for review July 16, 2026 21:46
@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.196 Update Island Media Controls to 0.9.207 Jul 17, 2026
@m417z

m417z commented Jul 17, 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. Corrupted (mojibake) characters — one of them breaks QQ Music detection. The file was clearly round-tripped through a non-UTF-8 editor at some point, corrupting the only two non-ASCII lines:

  • island-media-controls.wh.cpp:1523L"qq音乐" became L"qq闊充箰":
    lower.find(L"qq闊充箰") != std::wstring::npos ||   // was L"qq音乐"
    This is a functional regression: the QQ Music localized-name fallback in LooksLikeNativeMusicMediaSource no longer matches, so a session whose only identifying substring is the Chinese app name falls through to the browser heuristics and can be misclassified. The other substrings (qqmusic, tencent.qqmusic, tencentmusic) still work, so the impact is narrow, but it's an unintended change.
  • island-media-controls.wh.cpp:9974progress≈0.985 became progress鈮?.985 in a comment (cosmetic only, but same root cause).

Restore the correct characters and re-save the file as UTF-8. grep -nP '[^\x00-\x7F]' shows exactly these two lines, so they're easy to confirm.

Optional improvements

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

  • try/catch glued to a statement. In RenderPopupOverlayWgcFrame the success path ends with g_popupOverlayWgcFallbackPainted = false; } catch (winrt::hresult_error const& error) { on one line (around L8785). Purely a formatting nit, but worth splitting for readability.

  • A few added lines mix space indentation inside the tab-indented body (e.g. the artFade.IsHitTestVisible(false); / details.IsHitTestVisible(false); blocks). git diff --check is clean, so this is cosmetic only.

  • Untracked detached thread can outlive the mod. RequestPopupOverlayWgcBorderlessAccessAsync spawns a fire-and-forget std::thread(...).detach() that blocks in RequestAccessAsync(...).get(), then touches mod globals and calls Wh_Log. Nothing joins or waits for it — StopPopupOverlayWgcBackdrop's spin-wait only covers the WGC render callback (g_popupOverlayWgcRendering), not this thread. If the mod is unloaded while .get() is still pending, the thread resumes and executes code in the now-unmapped DLL image → crash. In explorer.exe (full-trust) the access request usually resolves near-instantly, so the race window is small, but it's real and the thread is entirely untracked. Track the thread and join it before returning from Wh_ModUninit (it resolves quickly in shell processes), so it can't outlive the DLL. If you're worried about it ever blocking, guard the join with a bounded wait like the media thread already does.

Functionality notes

Non-critical observations about the feature itself.

  • DisplacementDebugPreview ("Preview liquid glass displacement map"). This exposes a developer diagnostic — rendering the raw RG displacement texture instead of the material — as an end-user setting. It's harmless and you document it as a tuning aid, but consider whether a "show the debug texture" toggle really belongs in the shipped settings UI, or whether it's better left as a compile-time/internal switch. Not a blocker.
  • The taskbar-position awareness (TaskbarPopupOpensDown, top-taskbar open-down layout, edge-fade direction) and the new compact expanded layout are feature-behavior changes I couldn't fully exercise from static review — worth a sanity pass on a top-aligned taskbar and a mixed-DPI multi-monitor setup to confirm the popup direction and wash orientation line up.

@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.207 Update Island Media Controls to 0.9.208 Jul 17, 2026
@m417z

m417z commented Jul 17, 2026

Copy link
Copy Markdown
Member

Submission review

Check the note below. Also, fix the changelog on the top of the page so that the update can be submitted.


The free-threaded WGC frame callback now touches DirectComposition objects and shared UI state that the taskbar thread mutates concurrently, without a shared lock. This PR moves presentation onto the capture callback: RenderPopupOverlayWgcFrame (invoked from the CreateFreeThreaded frame pool's FrameArrived handler at island-media-controls.wh.cpp:9214) now runs outside g_popupOverlayWgcMutex (the mutex is only held to check g_popupOverlayWgcRunning, then released before the render — :9223/:9248), and inside it:

  • it calls g_popupOverlayDcompVisual->SetContent(...) + g_popupOverlayDcompDevice->Commit() (:8919:8927), while the taskbar thread concurrently calls g_popupOverlayDcompVisual->SetTransform(...) + g_popupOverlayDcompDevice->Commit() in UpdatePopupOverlayDcompVisualTransform (:8146/:8151), which UpdatePopupBackdropOverlayWindow invokes without the mutex during the morph (:10197, :10258);
  • it calls CalculatePopupBackdropOverlayRect (:8614), which reads g_settings (including the std::wstring material), g_layout, and the animation progress — while ApplyPendingSettings replaces g_settings wholesale (g_settings = std::move(*settings)) on the taskbar thread.

DirectComposition objects are not thread-safe, so a SetContent/Commit from the pool thread racing a SetTransform/Commit from the taskbar thread is a data race on the visual/device (worst case a device-removed error or a crash in Explorer), and the g_settings read can be a torn read of the wstring mid-reassignment. Both windows are the expand/collapse animation path, i.e. normal use. The previous version avoided this by doing the readback on the pool thread and marshaling the actual present to the UI thread via PostMessage; that handoff is now gone.

Suggested fix: serialize all DirectComposition visual/device access (and the shared g_settings/g_layout reads) under g_popupOverlayWgcMutex — e.g. hold the mutex across the render in the callback, and take it in UpdatePopupOverlayDcompVisualTransform — or snapshot the values the callback needs on the taskbar thread and pass them in. Note that if you extend the callback's lock to cover the whole render, keep StopPopupOverlayWgcBackdrop's existing drain-then-lock ordering so teardown doesn't deadlock against a long blur/present.

@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.208 Update Island Media Controls to 0.9.209 Jul 17, 2026
@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.209 Update Island Media Controls to 0.9.210 Jul 18, 2026
@usho-lear usho-lear changed the title Update Island Media Controls to 0.9.210 Update Island Media Controls to 0.9.211 Jul 18, 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