Skip to content

Commit

Permalink
wp_id: fallback to older WorkerW method
Browse files Browse the repository at this point in the history
  • Loading branch information
Francesco149 committed Mar 24, 2018
1 parent 41106fb commit ecce498
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/weebp.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

#define WP_VERSION_MAJOR 1 /* non-backwards-compatible changes */
#define WP_VERSION_MINOR 1 /* backwards compatible api changes */
#define WP_VERSION_PATCH 0 /* backwards-compatible changes */
#define WP_VERSION_PATCH 1 /* backwards-compatible changes */

#define STRINGIFY_(x) #x
#define STRINGIFY(x) STRINGIFY_(x)
Expand Down Expand Up @@ -404,8 +404,28 @@ wnd_t wp_id()

if (!worker)
{
wp_err("W: couldn't spawn WorkerW window, assuming Windows 7"
" and falling back to Progman");
wp_err("W: couldn't spawn WorkerW window, trying old method");
SendMessageA(progman, 0x052C, 0, 0);

log1("checking for wallpaper");
EnumWindows(find_worker, (LPARAM)&worker);

/*
* windows 7 with aero is almost the same as windows 10, except that we
* have to hide the WorkerW window and render to Progman child windows
* instead
*/

if (worker)
{
ShowWindow(worker, SW_HIDE);
worker = progman;
}
}

if (!worker)
{
wp_err("W: couldnt spawn window behind icons, falling back to Progman");
worker = progman;
}

Expand Down

0 comments on commit ecce498

Please sign in to comment.