Skip to content

[BUG] High CPU usage even when idle #827

Closed

Description

@DerDemystifier

Describe the bug

It’s at the top of the CPU usage list even when idle, and no music is playing.

The FAQ states:

There should be negligible or basically 0% CPU usage while running in the background on modern computers.

That's not the case unfortunately.

I’ve tried disabling the Taskbar widget and other settings, but it had no effect.

To Reproduce

Cannot reproduce effectively.

Logs, screenshots & additional context

Image

FluentFlyout Version

v2.11.2

Windows Version

Windows 11 Pro 25H2

Architecture

x64

Checklist

  • I have searched that there is no existing bug report regarding my issue
  • I have read the FAQ and there is no answer to my issue

Activity

  1. unchihugo commented on May 23, 2026

    @unchihugo
    Owner

    Hi @DerDemystifier, thanks for reporting. Do you still notice this behavior? If yes, could you list your computer specifications?

  2. DerDemystifier commented on May 23, 2026

    @DerDemystifier
    Author
    Processor	AMD Ryzen 5 5600GT
    System type	64-bit operating system
    

    I’ve figured out how to reproduce the problem—it happens when I press the media buttons. For instance, you can trigger the media track keypress in PowerShell if you don’t have it, and watch Task Manager; it will spike and stay at the top.

    (New-Object -ComObject WScript.Shell).SendKeys([char]176)
  3. unchihugo commented on May 23, 2026

    @unchihugo
    Owner

    Thanks for the information. Does CPU usage still spike if FluentFlyout is closed? If it doesn't, could you try disabling the media flyout to see if the CPU usage is still high then?

  4. DerDemystifier commented on May 29, 2026

    @DerDemystifier
    Author

    Disabling the media flyout doesn’t immediately stop the CPU usage spike. It only drops after I press a media key AFTER disabling the media flyout.

    I reckon it has something to do with the media flyout, but it could be some kind of process that persists even after the media flyout slides down.

    Is there a logging system in the app? It might be helpful to track metrics alongside events to pinpoint exactly when things went wrong.

    I must add that the bug is not reproducible 100% of the time. I only notice it when CoreTemp triggers the overheat protection balloon popup.

  5. github-actions commented on Sep 3, 2026

    @github-actions
    Contributor

    This issue has been inactive for a long time. If it is still relevant, please leave a comment to keep it open.

  6. lgc2333 commented on Sep 8, 2026

    @lgc2333
    Contributor

    please do not stale this issue

    startup
    Image

    pressed media key (pause/resume) and it keeps ~8% usage (i5-10400F)
    Image

  7. DerDemystifier commented on Sep 8, 2026

    @DerDemystifier
    Author

    Try resetting the settings; if I remember right, that fixed the issue for me. I also kept tweaking the default settings to a minimum, and I haven’t had this problem since.

    For a true fix, I think a better logging and monitoring needs to be implemented to better investigate performance issues like these.

  8. lgc2333 commented on Sep 8, 2026

    @lgc2333
    Contributor

    Reproduced this locally. Sustained 5-8% CPU happens when the taskbar's UIA tree is in a slow state (e.g. during auto-hide taskbar transitions); a CPU trace shows the hot frames are exactly the widget's UIA walk - AutomationElement.FindFirst, ProxyProviderFromHwnd, HwndProxyElementProvider.GetFirstChild, Accessible.GetChildren, WindowsRebar.GetFirstChild - plus Wait()-blocked UI thread timeouts (matches the Timeout querying taskbar XAML element: WidgetsButton warning in my logs).

    Draft fix: #1117 - non-blocking background queries with a 3s cache and proportional backoff when the walk is slow. Verified under the same stress: no sustained CPU, no timeouts.

  9. added a commit that references this issue on Sep 8, 2026
    9847a09
  10. lgc2333 commented on Sep 8, 2026

    @lgc2333
    Contributor

    I'm unsure this PR can fix this issue. Did you enabled taskbar widget and auto hide taskbar? @DerDemystifier

  11. DerDemystifier commented on Sep 8, 2026

    @DerDemystifier
    Author

    I don't use the auto-hide taskbar feature and only enabled the taskbar widget once when first testing the app. It had the acknowledged width and clipping issues with the tray icons, so I disabled it, it wasn't enabled when I was having the High CPU usage issue. After the reset, I never enabled it after.

    I can no longer reproduce the issue (unfortunately) with the media keys or otherwise.

    Here's an export of my current settings.
    FluentFlyout_Settings_2026-09-08_16-06-57.xml

  12. removed
    staleIssues & Pull Requests without any activity
    on Sep 8, 2026
  13. lgc2333 commented on Sep 9, 2026

    @lgc2333
    Contributor

    Correction to my earlier analysis: the cause is not taskbar widget UIA polling. I reproduced this and captured a CPU trace while it was happening.

    Trace (12 logical cores, ~8% = one core):

    13.87% excl  VolumeMixerWindow.HideVolumeOsd()
      Thread 0x9AC  CPU_TIME
        FluentFlyout!VolumeMixerWindow.HideVolumeOsd()
        FluentFlyout!VolumeMixerWindow+<>c.<ShowFlyout>b__16_0()
    

    HideVolumeOsd() runs on thread-pool threads started from ShowFlyout(). Two were spinning at capture time and still spinning when the trace ended.

    Cause. It enumerates XamlExplorerHostIslandWindow windows like this:

    while ((hwndXamlIsland = FindWindowEx(IntPtr.Zero, IntPtr.Zero, "XamlExplorerHostIslandWindow", null)) != IntPtr.Zero)

    Both handle arguments are NULL, so FindWindowEx returns the same first island every time and the body re-processes that one window forever. None of the three continue paths advances the cursor. When the first island is not the volume OSD (its InputSite window has a zero-size rect), the loop never exits.

    Why it matches your report. The keyboard hook calls volumeMixerWindow?.ShowFlyout() on every media/volume key when VolumeControlEnabled is set, so it starts on the first key press and persists; it does not need the taskbar widget. More key presses stack more spinning threads.

    Fix: #1122 — pass the previous handle as hwndChildAfter so enumeration walks the islands and terminates, matching the upstream gpkgpk/HideVolumeOSD code the port was based on.

    Before/after on one zero-rect island: the old loop hit 383,621 iterations in 5s without exiting; the fixed loop exits in one iteration and logs OSD window not found. With the fix, 20 volume keys leave CPU at 0% (was 8-9.5% sustained).

  14. DerDemystifier commented on Sep 18, 2026

    @DerDemystifier
    Author
    Image

    It does look like the issue originates from the FindWindowEx loop, and I think fix #1122 is right on target. Hopefully, @unchihugo merges it soon!

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions