diff --git a/gfx/common/win32_common.cpp b/gfx/common/win32_common.cpp index 907c5f4330..a9b122f777 100644 --- a/gfx/common/win32_common.cpp +++ b/gfx/common/win32_common.cpp @@ -101,9 +101,11 @@ static BOOL CALLBACK win32_monitor_enum_proc(HMONITOR hMonitor, void win32_monitor_from_window(HWND data, bool destroy) { +#ifndef _XBOX win32_monitor_last = MonitorFromWindow(data, MONITOR_DEFAULTTONEAREST); if (destroy) DestroyWindow(data); +#endif } void win32_monitor_get_info(void) @@ -679,6 +681,11 @@ static HANDLE GetFocus(void) { return g_hwnd; } + +BOOL IsIconic(HWND hwnd) +{ + return FALSE; +} #endif bool win32_has_focus(void) diff --git a/gfx/common/win32_common.h b/gfx/common/win32_common.h index 7178345c7e..db2b8758d2 100644 --- a/gfx/common/win32_common.h +++ b/gfx/common/win32_common.h @@ -41,9 +41,6 @@ LRESULT win32_handle_keyboard_event(HWND hwnd, UINT message, LRESULT win32_menu_loop(HWND handle, WPARAM wparam); - -void win32_monitor_from_window(HWND data, bool destroy); - void win32_monitor_get_info(void); void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id); @@ -51,6 +48,8 @@ void win32_monitor_info(void *data, void *hm_data, unsigned *mon_id); bool create_gl_context(HWND hwnd); #endif +void win32_monitor_from_window(HWND data, bool destroy); + void win32_monitor_init(void); bool win32_set_video_mode(void *data, @@ -84,4 +83,8 @@ void win32_window_reset(void); void win32_destroy_window(void); +#ifdef _XBOX +BOOL IsIconic(HWND hwnd); +#endif + #endif diff --git a/gfx/d3d/d3d.cpp b/gfx/d3d/d3d.cpp index ac1e12d725..7f212c6726 100644 --- a/gfx/d3d/d3d.cpp +++ b/gfx/d3d/d3d.cpp @@ -846,9 +846,7 @@ static void d3d_free(void *data) if (d3d->g_pD3D) d3d->g_pD3D->Release(); -#ifdef HAVE_MONITOR win32_monitor_from_window(window, true); -#endif if (d3d) delete d3d; @@ -1482,11 +1480,9 @@ static bool d3d_frame(void *data, const void *frame, rarch_perf_init(&d3d_frame, "d3d_frame"); retro_perf_start(&d3d_frame); -#ifndef _XBOX /* We cannot recover in fullscreen. */ if (d3d->needs_restore && IsIconic(window)) return true; -#endif if (d3d->needs_restore && !d3d_restore(d3d)) { RARCH_ERR("[D3D]: Failed to restore.\n");