mirror of
https://github.com/encounter/SDL.git
synced 2025-12-13 15:16:13 +00:00
Added a window flash operation to be explicit about window flash behavior
This commit is contained in:
@@ -1064,19 +1064,26 @@ WIN_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept)
|
||||
}
|
||||
|
||||
int
|
||||
WIN_FlashWindow(_THIS, SDL_Window * window)
|
||||
WIN_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation)
|
||||
{
|
||||
FLASHWINFO desc;
|
||||
const char *hint = SDL_GetHint(SDL_HINT_WINDOW_FLASH_COUNT);
|
||||
|
||||
SDL_zero(desc);
|
||||
desc.cbSize = sizeof(desc);
|
||||
desc.hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
|
||||
desc.dwFlags = FLASHW_TRAY;
|
||||
if (hint && *hint) {
|
||||
desc.uCount = SDL_atoi(hint);
|
||||
} else {
|
||||
desc.dwFlags |= FLASHW_TIMERNOFG;
|
||||
switch (operation) {
|
||||
case SDL_FLASH_CANCEL:
|
||||
desc.dwFlags = FLASHW_STOP;
|
||||
break;
|
||||
case SDL_FLASH_BRIEFLY:
|
||||
desc.dwFlags = FLASHW_TRAY;
|
||||
desc.uCount = 1;
|
||||
break;
|
||||
case SDL_FLASH_UNTIL_FOCUSED:
|
||||
desc.dwFlags = (FLASHW_TRAY | FLASHW_TIMERNOFG);
|
||||
break;
|
||||
default:
|
||||
return SDL_Unsupported();
|
||||
}
|
||||
|
||||
FlashWindowEx(&desc);
|
||||
|
||||
@@ -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);
|
||||
extern int WIN_FlashWindow(_THIS, SDL_Window * window, SDL_FlashOperation operation);
|
||||
|
||||
#endif /* SDL_windowswindow_h_ */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user