Skip to content

It takes a few seconds for WindowTop to switch a window to dark mode #482

Open

Description

@PaulSinnema

My guess is that WindowTop is polling for new Windows to open. Would it be possible to react to Windows events instead so windows go to dark mode immediately?

Something like:

HWINEVENTHOOK hook;

void CALLBACK WinEventProc(
    HWINEVENTHOOK hWinEventHook,
    DWORD event,
    HWND hwnd,
    LONG idObject,
    LONG idChild,
    DWORD idEventThread,
    DWORD dwmsEventTime)
{
    if (event == EVENT_OBJECT_CREATE && idObject == OBJID_WINDOW)
    {
        // A window was created
    }
}

hook = SetWinEventHook(
    EVENT_OBJECT_CREATE,
    EVENT_OBJECT_CREATE,
    NULL,
    WinEventProc,
    0,
    0,
    WINEVENT_OUTOFCONTEXT);

Activity

  1. thorn-cell commented on Apr 22, 2026

    @thorn-cell

    should start an open source windowtop

  2. gileli121 commented on Apr 23, 2026

    @gileli121
    Member

    Hello, I am aware about this option with SetWindowHook
    It just may be dangerous. such change is what I was planning as part of #369 (comment)

    I added it to #389 a while ago and will probably get to it soon, but it comes with the risk of bugs and needs plenty of testing. Even after that, dark mode is still expected to start a bit slowly, since this part is written in C++ and may take some time to load.

  3. gileli121 commented on May 6, 2026

    @gileli121
    Member

    I’m aware of it.

    This guy told this in 5:50:
    https://youtu.be/UXd8MfTJQVg?si=WAQMaK3IaGHhjW-r&t=350

    He wrote the official Task Manager in Windows 95, so he knows what he’s talking about. I’ll get into it the next time I work on it. However, testing such a change will take time, so if I do it, that version will be marked as beta for a relatively long period.

    Anyway, for most computers, the app uses no more than 2% CPU, though it still spends a lot of time sleeping. Still, I agree it could be optimized further.

    I’m currently working on a memory (RAM) optimization issue that seems especially relevant for ARM64-based systems, as noted in a Reddit thread. It’s probably even more significant considering the recent crisis in RAM chip prices, which have increased sharply.

    This one is an easy fix. I hope that after fixing it, I can move on to working on this optimization.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions