Parcourir la source

Tooltips and unfocusable windows can't become main windows

Sam Lantinga il y a 3 mois
Parent
commit
a446381ea9
1 fichiers modifiés avec 4 ajouts et 2 suppressions
  1. 4 2
      src/video/cocoa/SDL_cocoawindow.m

+ 4 - 2
src/video/cocoa/SDL_cocoawindow.m

@@ -36,7 +36,9 @@
 #include "SDL_cocoaopengles.h"
 #include "SDL_cocoavideo.h"
 
-// #define DEBUG_COCOAWINDOW
+#if 0
+#define DEBUG_COCOAWINDOW
+#endif
 
 #ifdef DEBUG_COCOAWINDOW
 #define DLog(fmt, ...) printf("%s: " fmt "\n", __func__, ##__VA_ARGS__)
@@ -125,7 +127,7 @@
 - (BOOL)canBecomeMainWindow
 {
     SDL_Window *window = [self findSDLWindow];
-    if (window && !SDL_WINDOW_IS_POPUP(window)) {
+    if (window && !(window->flags & (SDL_WINDOW_TOOLTIP | SDL_WINDOW_NOT_FOCUSABLE)) && !SDL_WINDOW_IS_POPUP(window)) {
         return YES;
     } else {
         return NO;