Implement bare minimum for SDL_FlashWindow

This commit is contained in:
Jupeyy
2021-06-04 19:55:30 +02:00
committed by Sam Lantinga
parent 64c40b9028
commit 64724db0a1
11 changed files with 74 additions and 0 deletions

View File

@@ -176,6 +176,7 @@ WIN_CreateDevice(int devindex)
device->OnWindowEnter = WIN_OnWindowEnter;
device->SetWindowHitTest = WIN_SetWindowHitTest;
device->AcceptDragAndDrop = WIN_AcceptDragAndDrop;
device->FlashWindow = WIN_FlashWindow;
device->shape_driver.CreateShaper = Win32_CreateShaper;
device->shape_driver.SetWindowShape = Win32_SetWindowShape;

View File

@@ -1084,6 +1084,24 @@ WIN_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept)
DragAcceptFiles(data->hwnd, accept ? TRUE : FALSE);
}
int
WIN_FlashWindow(_THIS, SDL_Window * window, Uint32 flash_count)
{
HWND hwnd;
FLASHWINFO desc;
hwnd = ((SDL_WindowData *) window->driverdata)->hwnd;
desc.cbSize = sizeof(desc);
desc.hwnd = hwnd;
desc.dwFlags = FLASHW_TRAY;
desc.uCount = flash_count; /* flash x times */
desc.dwTimeout = 0;
FlashWindowEx(&desc);
return 0;
}
#endif /* SDL_VIDEO_DRIVER_WINDOWS */
/* vi: set ts=4 sw=4 expandtab: */

View File

@@ -86,6 +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);
#endif /* SDL_windowswindow_h_ */