Skip to content
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.

Commit

Permalink
Potential fix for Win11 24H2
Browse files Browse the repository at this point in the history
  • Loading branch information
zuranthus committed Dec 6, 2024
1 parent b83bf2b commit 9332440
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/platform_windows.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,9 +116,6 @@ void PlatformInit(struct Context *context) {
if (tray_init(&tray) == -1)
FAIL_WITH("can't create tray with icon '%s'", tray.icon);

// Get the handle of the parent
// On Win8+: WorkerW window, a previous sibling of Progman
// On Win7: Progman window; also need to hide WorkerW window when Aero is on
HWND progman = FindWindow("Progman", NULL);
if (progman == NULL) FAIL();
// Send the (undocumented) message to trigger the creation of WorkerW in required position
Expand All @@ -127,12 +124,9 @@ void PlatformInit(struct Context *context) {
HWND workerw = GetWindow(progman, GW_HWNDPREV);
char classname[8] = {0};
if (workerw && GetClassName(workerw, classname, 8) == 0 || strcmp(TEXT("WorkerW"), classname) != 0)
workerw = NULL;
workerw = FindWindowEx(progman, NULL, "WorkerW", NULL);

HWND sdl_parent_hwnd = workerw;
if (!IsWindows8OrGreater()) {
if (workerw) ShowWindow(workerw, SW_HIDE);
sdl_parent_hwnd = progman;
}
if (!sdl_parent_hwnd) FAIL();

SDL_Window *window = SDL_CreateWindow("live-paper",
Expand Down

0 comments on commit 9332440

Please sign in to comment.