Вынес проверку «освобождён → клик в окне → recapture_pointer()» из-под debug-гейта в sdl/window.cpp и sdl3/window.cpp — теперь она выполняется всегда, как на Windows.
This commit is contained in:
parent
6b6a5b0f9c
commit
b0c4527c2e
2
makefile
2
makefile
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
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 - 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()
|
||||||
|
&& (SDL_GetMouseFocus() == platform_window())
|
||||||
|
&& (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON(SDL_BUTTON_LEFT)))
|
||||||
|
sdlosd.recapture_pointer();
|
||||||
|
|
||||||
// do not do mouse capture if the debugger's enabled to avoid
|
// do not do mouse capture if the debugger's enabled to avoid
|
||||||
// the possibility of losing control
|
// the possibility of losing control
|
||||||
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
||||||
{
|
{
|
||||||
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 (sdlosd.pointer_released()
|
|
||||||
&& (SDL_GetMouseFocus() == platform_window())
|
|
||||||
&& (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON(SDL_BUTTON_LEFT)))
|
|
||||||
sdlosd.recapture_pointer();
|
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
@ -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
|
||||||
|
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 - 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()
|
||||||
|
&& (SDL_GetMouseFocus() == platform_window())
|
||||||
|
&& (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON_MASK(SDL_BUTTON_LEFT)))
|
||||||
|
sdlosd.recapture_pointer();
|
||||||
|
|
||||||
// do not do mouse capture if the debugger's enabled to avoid
|
// do not do mouse capture if the debugger's enabled to avoid
|
||||||
// the possibility of losing control
|
// the possibility of losing control
|
||||||
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
if (!(machine().debug_flags & DEBUG_FLAG_OSD_ENABLED))
|
||||||
{
|
{
|
||||||
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 (sdlosd.pointer_released()
|
|
||||||
&& (SDL_GetMouseFocus() == platform_window())
|
|
||||||
&& (SDL_GetMouseState(nullptr, nullptr) & SDL_BUTTON_MASK(SDL_BUTTON_LEFT)))
|
|
||||||
sdlosd.recapture_pointer();
|
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user