Previous 199869 Revisions Next

r19916 Saturday 29th December, 2012 at 11:27:56 UTC by Oliver Stöneberg
fixed MT#4846: make sure, that we always get a win_monitor_info* in winwindow_video_window_monitor() [Oliver Stöneberg]
[src/osd/windows]window.c

trunk/src/osd/windows/window.c
r19915r19916
834834
835835win_monitor_info *winwindow_video_window_monitor(win_window_info *window, const RECT *proposed)
836836{
837   win_monitor_info *monitor;
837   win_monitor_info *monitor = NULL;
838838
839839   // in window mode, find the nearest
840840   if (!window->fullscreen)
841841   {
842      if (proposed != NULL)
843         monitor = winvideo_monitor_from_handle(MonitorFromRect(proposed, MONITOR_DEFAULTTONEAREST));
844      else
845         monitor = winvideo_monitor_from_handle(MonitorFromWindow(window->hwnd, MONITOR_DEFAULTTONEAREST));
842      // result can be NULL when e.g. the color scheme changes
843      do
844      {
845         if (proposed != NULL)
846            monitor = winvideo_monitor_from_handle(MonitorFromRect(proposed, MONITOR_DEFAULTTONEAREST));
847         else
848            monitor = winvideo_monitor_from_handle(MonitorFromWindow(window->hwnd, MONITOR_DEFAULTTONEAREST));
849      } while (monitor == NULL);
846850   }
847851
848852   // in full screen, just use the configured monitor

Previous 199869 Revisions Next


© 1997-2024 The MAME Team