Вынес проверку «освобождён → клик в окне → recapture_pointer()» из-под debug-гейта в sdl/window.cpp и sdl3/window.cpp — теперь она выполняется всегда, как на Windows.
Some checks failed
CI (macOS) / build-macos (push) Has been cancelled
CI (Windows) / build-windows (gcc, gcc-x64, g++, mame, UCRT64, windows-latest, mingw-w64-ucrt-x86_64, mame) (push) Has been cancelled

This commit is contained in:
Tolik 2026-05-26 22:52:53 +10:00
parent 6b6a5b0f9c
commit b0c4527c2e
3 changed files with 25 additions and 17 deletions

View File

@ -1037,7 +1037,7 @@ else
OLD_GIT_VERSION := $(shell cat $(GENDIR)/git_desc 2> NUL) OLD_GIT_VERSION := $(shell cat $(GENDIR)/git_desc 2> NUL)
endif endif
ifneq ($(IGNORE_GIT),1) ifneq ($(IGNORE_GIT),1)
NEW_GIT_VERSION := $(shell git describe --dirty) NEW_GIT_VERSION := $(shell git describe --dirty --always)
else else
NEW_GIT_VERSION := unknown NEW_GIT_VERSION := unknown
endif endif

View File

@ -281,18 +281,22 @@ void sdl_window_info::update_cursor_state()
c=SDL_CreateCursor(data, data, 8, 8, 0, 0); c=SDL_CreateCursor(data, data, 8, 8, 0, 0);
SDL_SetCursor(c); SDL_SetCursor(c);
#else #else
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
auto &sdlosd = downcast<sdl_osd_interface&>(machine().osd()); auto &sdlosd = downcast<sdl_osd_interface&>(machine().osd());
// if the pointer was freed to the OS, re-capture when the user clicks back in the window // if the pointer was freed to the OS, re-capture when the user clicks back in
// the window - do this even with the debugger enabled, otherwise the pointer
// (and all input, since polling is suspended while released) gets stuck with no
// way to recover: the recapture combo can't re-fire because the keyboard isn't
// polled, so the click is the only escape hatch
if (sdlosd.pointer_released() if (sdlosd.pointer_released()
&& (SDL_GetMouseFocus() == platform_window()) && (SDL_GetMouseFocus() == platform_window())
&& (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON(SDL_BUTTON_LEFT))) && (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON(SDL_BUTTON_LEFT)))
sdlosd.recapture_pointer(); sdlosd.recapture_pointer();
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
bool should_hide_mouse = sdlosd.should_hide_mouse(); bool should_hide_mouse = sdlosd.should_hide_mouse();
if (!fullscreen() && !should_hide_mouse) if (!fullscreen() && !should_hide_mouse)

View File

@ -280,18 +280,22 @@ void sdl_window_info::update_cursor_state()
c=SDL_CreateCursor(data, data, 8, 8, 0, 0); c=SDL_CreateCursor(data, data, 8, 8, 0, 0);
SDL_SetCursor(c); SDL_SetCursor(c);
#else #else
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
auto &sdlosd = downcast<sdl_osd_interface&>(machine().osd()); auto &sdlosd = downcast<sdl_osd_interface&>(machine().osd());
// if the pointer was freed to the OS, re-capture when the user clicks back in the window // if the pointer was freed to the OS, re-capture when the user clicks back in
// the window - do this even with the debugger enabled, otherwise the pointer
// (and all input, since polling is suspended while released) gets stuck with no
// way to recover: the recapture combo can't re-fire because the keyboard isn't
// polled, so the click is the only escape hatch
if (sdlosd.pointer_released() if (sdlosd.pointer_released()
&& (SDL_GetMouseFocus() == platform_window()) && (SDL_GetMouseFocus() == platform_window())
&& (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON_MASK(SDL_BUTTON_LEFT))) && (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON_MASK(SDL_BUTTON_LEFT)))
sdlosd.recapture_pointer(); sdlosd.recapture_pointer();
// do not do mouse capture if the debugger's enabled to avoid
// the possibility of losing control
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
{
bool should_hide_mouse = sdlosd.should_hide_mouse(); bool should_hide_mouse = sdlosd.should_hide_mouse();
if (!fullscreen() && !should_hide_mouse) if (!fullscreen() && !should_hide_mouse)