Changed SDL_FlashWindow() so it doesn't take a flash count, and added the hint SDL_HINT_WINDOW_FLASH_COUNT to control behavior on Windows

This commit is contained in:
Sam Lantinga
2021-07-24 12:11:27 -07:00
parent 09d1cea733
commit e1c3a25034
14 changed files with 40 additions and 22 deletions

View File

@@ -1064,17 +1064,20 @@ WIN_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept)
}
int
WIN_FlashWindow(_THIS, SDL_Window * window, Uint32 flash_count)
WIN_FlashWindow(_THIS, SDL_Window * window)
{
HWND hwnd;
FLASHWINFO desc;
const char *hint = SDL_GetHint(SDL_HINT_WINDOW_FLASH_COUNT);
hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
SDL_zero(desc);
desc.cbSize = sizeof(desc);
desc.hwnd = hwnd;
desc.hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
desc.dwFlags = FLASHW_TRAY;
desc.uCount = flash_count; /* flash x times */
desc.dwTimeout = 0;
if (hint && *hint) {
desc.uCount = SDL_atoi(hint);
} else {
desc.dwFlags |= FLASHW_TIMERNOFG;
}
FlashWindowEx(&desc);

View File

@@ -86,7 +86,7 @@ extern void WIN_OnWindowEnter(_THIS, SDL_Window * window);
extern void WIN_UpdateClipCursor(SDL_Window *window);
extern int WIN_SetWindowHitTest(SDL_Window *window, SDL_bool enabled);
extern void WIN_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept);
extern int WIN_FlashWindow(_THIS, SDL_Window * window, Uint32 flash_count);
extern int WIN_FlashWindow(_THIS, SDL_Window * window);
#endif /* SDL_windowswindow_h_ */