Open stargoonman opened 6 years ago
You dont use alt-tab combo. You use alt-enter. :)
I'm aware of the workaround, but it is not a fix to the issue.
It's a legitimate bug - bgfx uses an floating, borderless window rather than exclusive fullscreen mode, and this should be hidden when MAME loses focus.
Is this still a problem? It works correctly for me.
Nothing heard; closing.
Can still repro it: mame64 ridgerac -nowindow -video opengl
Alt-tab to a different program. Ridge Racer is still visible in fullscreen but inputs are unfocused and MAME will seem unresponsive.
This serves as a workaround:
index ca62d750f50..ba4d268f270 100644
--- a/src/osd/windows/window.cpp
+++ b/src/osd/windows/window.cpp
@@ -1346,6 +1346,11 @@ LRESULT CALLBACK win_window_info::video_window_proc(HWND wnd, UINT message, WPAR
}
return DefWindowProc(wnd, message, wparam, lparam);
+ case WM_ACTIVATE:
+ if (window->has_renderer() && window->fullscreen() && (LOWORD(wparam) == WA_INACTIVE) && !is_mame_window(HWND(lparam)))
+ if (osd_common_t::s_window_list.size()) winwindow_toggle_full_screen();
+ break;
+
// close: cause MAME to exit
case WM_CLOSE:
window->machine().schedule_exit();
It just toggles windowed mode when focus is lost.
It would be better to hide the fullscreen window though, to be consistent with other platforms.
7cfe419ca809eb8572f5a0c1e85e8170342c028e should address this. It seems to mostly work, but with multiple screens by repeatedly alt-tab’ing in and out I could sometimes get it to minimise one window but not the other. It corrects itself if you alt-tab in and out a couple of times though. If someone else wants to work out what’s going on there, feel free to.
but with multiple screens by repeatedly alt-tab’ing in and out I could sometimes get it to minimise one window but not the other.
I've been playing with this, it looks like setting the first window as foreground after SW_RESTORE fixes it.
if ((wparam == WA_ACTIVE) || (wparam == WA_CLICKACTIVE))
{
for (const auto &w : osd_common_t::s_window_list)
ShowWindow(std::static_pointer_cast<win_window_info>(w)->platform_window(), SW_RESTORE);
SetForegroundWindow(std::static_pointer_cast<win_window_info>(osd_common_t::s_window_list.front())->platform_window());
}
If the mame runs a machine on non-d3d video settings, the screen will stay topmost, even though the window is deselected.
If you alt-tab, it will select other window, but the mame window will stay topmost regardless. This may look like mame is ignoring inputs to the uninitiated.