Skip to content

Win11 taskbar background is black in Classic theme in version 197, as expected in 191 #2441

@Anixx

Description

@Anixx

Describe the bug

This is under version 191:

Image

Under version 197:

Image

Area of issue

Taskbar

To reproduce

  1. Use these settings with the Taskbar Styler Windhawk mod:

{"theme":"","controlStyles[0].target":"TextBlock#LabelControl","controlStyles[0].styles[0]":"FontFamily=Tahoma","controlStyles[1].target":"Taskbar.TaskListButton","controlStyles[1].styles[0]":"CornerRadius=0","controlStyles[2].target":"Rectangle#BackgroundFill","controlStyles[2].styles[0]":"Fill=Transparent","controlStyles[3].target":"Taskbar.TaskListButton#TaskListButton","controlStyles[3].styles[0]":"VerticalAlignment=3","controlStyles[4].target":"Taskbar.TaskListLabeledButtonPanel@RunningIndicatorStates > Rectangle#RunningIndicator","controlStyles[4].styles[0]":"Height=2","controlStyles[5].target":"Microsoft.UI.Xaml.Controls.AnimatedVisualPlayer#Icon","controlStyles[5].styles[0]":"IsVisible=0","controlStyles[3].styles[1]":"","resourceVariables[0].variableKey":"","resourceVariables[0].value":""}

The key value here is
"controlStyles[2].target":"Rectangle#BackgroundFill","controlStyles[2].styles[0]":"Fill=Transparent"

  1. And use this mod to refresh the taskbar:
// ==WindhawkMod==
// @id              win1-taskbar-classic-theme-helper
// @name            Win11 Taskbar Classic helper
// @version         1.0.0
// @author          Anixx
// @include         explorer.exe
// ==/WindhawkMod==

void ApplyTaskbarMod() {
    HWND hTaskbar = FindWindow(L"Shell_TrayWnd", NULL);
    if (!hTaskbar) return;

    SetWindowLong(hTaskbar, GWL_STYLE, GetWindowLong(hTaskbar, GWL_STYLE) & ~0x840000);

    HWND h = FindWindowEx(hTaskbar, NULL, L"ReBarWindow32", NULL);
    if (h) ShowWindow(h, SW_HIDE);

    h = FindWindowEx(hTaskbar, NULL,
        L"Windows.UI.Composition.DesktopWindowContentBridge", NULL);
    if (h) {
        ShowWindow(h, SW_HIDE);
        ShowWindow(h, SW_SHOW);
    }

    h = FindWindowEx(hTaskbar, NULL, L"TrayNotifyWnd", NULL);
    if (h) ShowWindow(h, SW_SHOW);
}

DWORD WINAPI WorkerThread(LPVOID) {
    for (int i = 0; i < 10; i++) {
        Sleep(1000);
        ApplyTaskbarMod();
    }
    return 0;
}

BOOL Wh_ModInit() {
    ApplyTaskbarMod();
    HANDLE h = CreateThread(NULL, 0, WorkerThread, NULL, 0, NULL);
    if (h) CloseHandle(h);
    return TRUE;
}

void Wh_ModUninit() {
}

Expected behavior

Th taskbar is of the ButtonFace color

Open-Shell version

4.4.197

Windows version

Windows 11 23H2

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugSomething isn't working right.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions