Implement initial Wayland support
[freeglut] / src / mswin / fg_main_mswin.c
index 137fc06..54ec12c 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * freeglut_main_mswin.c
+ * fg_main_mswin.c
  *
  * The Windows-specific mouse cursor related stuff.
  *
@@ -1640,8 +1640,7 @@ void fgPlatformPosResZordWork(SFG_Window* window, unsigned int workMask)
             /* For fullscreen mode, find the monitor that is covered the most
                 * by the window and get its rect as the resize target.
                    */
-            GetWindowRect(window->Window.Handle, &rect);
-            hMonitor= MonitorFromRect(&rect, MONITOR_DEFAULTTONEAREST);
+            hMonitor= MonitorFromWindow(window->Window.Handle, MONITOR_DEFAULTTONEAREST);
             mi.cbSize = sizeof(mi);
             GetMonitorInfo(hMonitor, &mi);
             rect = mi.rcMonitor;
@@ -1759,8 +1758,8 @@ void fgPlatformVisibilityWork(SFG_Window* window)
             win = win->Parent;
         break;
     case DesireNormalState:
-        if (win->IsMenu && (!fgStructure.GameModeWindow || win->ActiveMenu->ParentWindow != fgStructure.GameModeWindow))
-            cmdShow = SW_SHOWNA;    /* Just show, don't activate window if its a menu. Only exception is when the parent is a gamemode window as the menu would pop under it when we do this... */
+        if (win->IsMenu && !fgStructure.GameModeWindow)
+            cmdShow = SW_SHOWNA;    /* Just show, don't activate window if its a menu. Only exception is when there is a gamemode window as the menu would pop under it when we do this... */
         else
             cmdShow = SW_SHOW;
         break;