src/video/SDL_video.c
changeset 12070 1d65571b57dd
parent 12017 d8a165136edf
child 12143 673ec0369266
equal deleted inserted replaced
12069:317db3d3712c 12070:1d65571b57dd
  1329 }
  1329 }
  1330 
  1330 
  1331 #define CREATE_FLAGS \
  1331 #define CREATE_FLAGS \
  1332     (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_ALWAYS_ON_TOP | SDL_WINDOW_SKIP_TASKBAR | SDL_WINDOW_POPUP_MENU | SDL_WINDOW_UTILITY | SDL_WINDOW_TOOLTIP | SDL_WINDOW_VULKAN | SDL_WINDOW_MINIMIZED)
  1332     (SDL_WINDOW_OPENGL | SDL_WINDOW_BORDERLESS | SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI | SDL_WINDOW_ALWAYS_ON_TOP | SDL_WINDOW_SKIP_TASKBAR | SDL_WINDOW_POPUP_MENU | SDL_WINDOW_UTILITY | SDL_WINDOW_TOOLTIP | SDL_WINDOW_VULKAN | SDL_WINDOW_MINIMIZED)
  1333 
  1333 
       
  1334 static SDL_INLINE SDL_bool
       
  1335 IsAcceptingDragAndDrop(void)
       
  1336 {
       
  1337     if ((SDL_GetEventState(SDL_DROPFILE) == SDL_ENABLE) ||
       
  1338         (SDL_GetEventState(SDL_DROPTEXT) == SDL_ENABLE)) {
       
  1339         return SDL_TRUE;
       
  1340     }
       
  1341     return SDL_FALSE;
       
  1342 }
       
  1343 
       
  1344 /* prepare a newly-created window */
       
  1345 static SDL_INLINE void
       
  1346 PrepareDragAndDropSupport(SDL_Window *window)
       
  1347 {
       
  1348     if (_this->AcceptDragAndDrop) {
       
  1349         _this->AcceptDragAndDrop(window, IsAcceptingDragAndDrop());
       
  1350     }
       
  1351 }
       
  1352 
       
  1353 /* toggle d'n'd for all existing windows. */
       
  1354 void
       
  1355 SDL_ToggleDragAndDropSupport(void)
       
  1356 {
       
  1357     if (_this && _this->AcceptDragAndDrop) {
       
  1358         const SDL_bool enable = IsAcceptingDragAndDrop();
       
  1359         SDL_Window *window;
       
  1360         for (window = _this->windows; window; window = window->next) {
       
  1361             _this->AcceptDragAndDrop(window, enable);
       
  1362         }
       
  1363     }
       
  1364 }
       
  1365 
  1334 static void
  1366 static void
  1335 SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags)
  1367 SDL_FinishWindowCreation(SDL_Window *window, Uint32 flags)
  1336 {
  1368 {
       
  1369     PrepareDragAndDropSupport(window);
       
  1370 
  1337     if (flags & SDL_WINDOW_MAXIMIZED) {
  1371     if (flags & SDL_WINDOW_MAXIMIZED) {
  1338         SDL_MaximizeWindow(window);
  1372         SDL_MaximizeWindow(window);
  1339     }
  1373     }
  1340     if (flags & SDL_WINDOW_MINIMIZED) {
  1374     if (flags & SDL_WINDOW_MINIMIZED) {
  1341         SDL_MinimizeWindow(window);
  1375         SDL_MinimizeWindow(window);
  1550 
  1584 
  1551     if (_this->CreateSDLWindowFrom(_this, window, data) < 0) {
  1585     if (_this->CreateSDLWindowFrom(_this, window, data) < 0) {
  1552         SDL_DestroyWindow(window);
  1586         SDL_DestroyWindow(window);
  1553         return NULL;
  1587         return NULL;
  1554     }
  1588     }
       
  1589 
       
  1590     PrepareDragAndDropSupport(window);
       
  1591 
  1555     return window;
  1592     return window;
  1556 }
  1593 }
  1557 
  1594 
  1558 int
  1595 int
  1559 SDL_RecreateWindow(SDL_Window * window, Uint32 flags)
  1596 SDL_RecreateWindow(SDL_Window * window, Uint32 flags)