printf("ShlProc: %p - %s\n", hwnd, msg == HSHELL_REDRAW ?
"redraw" : "window created");
if (!(win = win_find(hwnd,0)))
if ((win = win_find(hwnd,1)))
wm_insert(win);
return 1;
printf("ShlProc: %p - %s\n", hwnd, msg == HSHELL_REDRAW ?
"redraw" : "window created");
if (!(win = win_find(hwnd,0)))
if ((win = win_find(hwnd,1)))
wm_insert(win);
return 1;
- printf("ShlProc: %p - window destroyed\n", hwnd);
+ printf("ShlProc: %p - %s\n", hwnd, msg == HSHELL_WINDOWREPLACED ?
+ "window replaced" : "window destroyed");
wm_remove(win);
win_remove(win);
}
return 1;
case HSHELL_WINDOWACTIVATED:
printf("ShlProc: %p - window activated\n", hwnd);
wm_remove(win);
win_remove(win);
}
return 1;
case HSHELL_WINDOWACTIVATED:
printf("ShlProc: %p - window activated\n", hwnd);
return 0;
default:
printf("ShlProc: %p - unknown msg, %d\n", hwnd, msg);
return 0;
default:
printf("ShlProc: %p - unknown msg, %d\n", hwnd, msg);
screen->w = work->right - work->left;
screen->h = work->bottom - work->top;
*screens = list_append(*screens, screen);
screen->w = work->right - work->left;
screen->h = work->bottom - work->top;
*screens = list_append(*screens, screen);
/* Windows prevents a thread from using SetForegroundInput under
* certain circumstances and instead flashes the windows toolbar icon.
* Attaching the thread input queues avoids this behavior */
/* Windows prevents a thread from using SetForegroundInput under
* certain circumstances and instead flashes the windows toolbar icon.
* Attaching the thread input queues avoids this behavior */
- DWORD oldId = GetWindowThreadProcessId(GetForegroundWindow(), NULL);
+ HWND fgWin = GetForegroundWindow();
+ if (fgWin == win->sys->hwnd)
+ return; // already focused
+ DWORD oldId = GetWindowThreadProcessId(fgWin, NULL);
HWND next = GetWindow(win->sys->hwnd, GW_HWNDNEXT);
SetWindowPos(win->sys->hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
if (next)
SetWindowPos(win->sys->hwnd, next, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
HWND next = GetWindow(win->sys->hwnd, GW_HWNDNEXT);
SetWindowPos(win->sys->hwnd, NULL, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
if (next)
SetWindowPos(win->sys->hwnd, next, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE);
[st_icon ] {"icon" , SW_MINIMIZE},
[st_hide ] {"hide" , SW_HIDE },
};
[st_icon ] {"icon" , SW_MINIMIZE},
[st_hide ] {"hide" , SW_HIDE },
};
win->state = state;
printf("sys_show: %s\n", map[state].str);
ShowWindow(win->sys->hwnd, map[state].cmd);
win->state = state;
printf("sys_show: %s\n", map[state].str);
ShowWindow(win->sys->hwnd, map[state].cmd);