cocoa: Implement FlashWindow
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
diff --git a/src/video/cocoa/SDL_cocoavideo.m b/src/video/cocoa/SDL_cocoavideo.m
index f16b8aa..cf6d846 100644
--- a/src/video/cocoa/SDL_cocoavideo.m
+++ b/src/video/cocoa/SDL_cocoavideo.m
@@ -107,6 +107,7 @@ Cocoa_CreateDevice(int devindex)
device->GetWindowWMInfo = Cocoa_GetWindowWMInfo;
device->SetWindowHitTest = Cocoa_SetWindowHitTest;
device->AcceptDragAndDrop = Cocoa_AcceptDragAndDrop;
+ device->FlashWindow = Cocoa_FlashWindow;
device->shape_driver.CreateShaper = Cocoa_CreateShaper;
device->shape_driver.SetWindowShape = Cocoa_SetWindowShape;
diff --git a/src/video/cocoa/SDL_cocoawindow.h b/src/video/cocoa/SDL_cocoawindow.h
index a2000d4..96f84f2 100644
--- a/src/video/cocoa/SDL_cocoawindow.h
+++ b/src/video/cocoa/SDL_cocoawindow.h
@@ -151,6 +151,7 @@ extern void Cocoa_DestroyWindow(_THIS, SDL_Window * window);
extern SDL_bool Cocoa_GetWindowWMInfo(_THIS, SDL_Window * window, struct SDL_SysWMinfo *info);
extern int Cocoa_SetWindowHitTest(SDL_Window *window, SDL_bool enabled);
extern void Cocoa_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept);
+extern int Cocoa_FlashWindow(_THIS, SDL_Window * window, Uint32 flash_count);
#endif /* SDL_cocoawindow_h_ */
diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m
index 2b5d2de..148e2fb 100644
--- a/src/video/cocoa/SDL_cocoawindow.m
+++ b/src/video/cocoa/SDL_cocoawindow.m
@@ -2117,6 +2117,15 @@ Cocoa_AcceptDragAndDrop(SDL_Window * window, SDL_bool accept)
}
int
+Cocoa_FlashWindow(_THIS, SDL_Window *window, Uint32 flash_count)
+{ @autoreleasepool
+{
+ /* Note that this is app-wide and not window-specific! */
+ [NSApp requestUserAttention:NSInformationalRequest];
+ return 0;
+}}
+
+int
Cocoa_SetWindowOpacity(_THIS, SDL_Window * window, float opacity)
{
SDL_WindowData *data = (SDL_WindowData *) window->driverdata;