mirror of
https://github.com/joncampbell123/dosbox-x.git
synced 2025-05-07 18:36:09 +08:00
Bug fix: Keep the user mouse dimensions reported to the guest up to date with the window size, instead of only whenever the mouse moves
This commit is contained in:
parent
383ed6e4cf
commit
921acaa291
@ -2090,6 +2090,7 @@ void drawmenu(Bitu) {
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
void RENDER_Reset(void);
|
void RENDER_Reset(void);
|
||||||
|
void UpdateUserCursorScreenDimensions(void);
|
||||||
|
|
||||||
Bitu GFX_SetSize(Bitu width, Bitu height, Bitu flags, double scalex, double scaley, GFX_CallBack_t callback)
|
Bitu GFX_SetSize(Bitu width, Bitu height, Bitu flags, double scalex, double scaley, GFX_CallBack_t callback)
|
||||||
{
|
{
|
||||||
@ -2242,7 +2243,7 @@ Bitu GFX_SetSize(Bitu width, Bitu height, Bitu flags, double scalex, double scal
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
UpdateWindowDimensions();
|
UpdateWindowDimensions();
|
||||||
|
UpdateUserCursorScreenDimensions();
|
||||||
#if defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
#if defined(WIN32) && !defined(HX_DOS) && !defined(_WIN32_WINDOWS)
|
||||||
WindowsTaskbarUpdatePreviewRegion();
|
WindowsTaskbarUpdatePreviewRegion();
|
||||||
#endif
|
#endif
|
||||||
@ -4465,6 +4466,16 @@ bool GFX_CursorInOrNearScreen(int wx,int wy) {
|
|||||||
return (wx >= minx && wx < maxx) && (wy >= miny && wy < maxy);
|
return (wx >= minx && wx < maxx) && (wy >= miny && wy < maxy);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UpdateUserCursorScreenDimensions(void) {
|
||||||
|
user_cursor_sw = sdl.clip.w;
|
||||||
|
user_cursor_sh = sdl.clip.h;
|
||||||
|
|
||||||
|
if (video_debug_overlay && vga.draw.width < render.src.width) {
|
||||||
|
user_cursor_sw = (vga.draw.width*user_cursor_sw)/render.src.width;
|
||||||
|
user_cursor_sh = (vga.draw.height*user_cursor_sh)/render.src.height;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void HandleMouseMotion(SDL_MouseMotionEvent * motion) {
|
static void HandleMouseMotion(SDL_MouseMotionEvent * motion) {
|
||||||
bool inputToScreen = false;
|
bool inputToScreen = false;
|
||||||
|
|
||||||
@ -4547,13 +4558,8 @@ static void HandleMouseMotion(SDL_MouseMotionEvent * motion) {
|
|||||||
user_cursor_y = motion->y - sdl.clip.y;
|
user_cursor_y = motion->y - sdl.clip.y;
|
||||||
user_cursor_locked = sdl.mouse.locked;
|
user_cursor_locked = sdl.mouse.locked;
|
||||||
user_cursor_emulation = sdl.mouse.emulation;
|
user_cursor_emulation = sdl.mouse.emulation;
|
||||||
user_cursor_sw = sdl.clip.w;
|
|
||||||
user_cursor_sh = sdl.clip.h;
|
|
||||||
|
|
||||||
if (video_debug_overlay && vga.draw.width < render.src.width) {
|
UpdateUserCursorScreenDimensions();
|
||||||
user_cursor_sw = (vga.draw.width*user_cursor_sw)/render.src.width;
|
|
||||||
user_cursor_sh = (vga.draw.height*user_cursor_sh)/render.src.height;
|
|
||||||
}
|
|
||||||
|
|
||||||
auto xrel = static_cast<float>(motion->xrel) * sdl.mouse.xsensitivity / 100.0f;
|
auto xrel = static_cast<float>(motion->xrel) * sdl.mouse.xsensitivity / 100.0f;
|
||||||
auto yrel = static_cast<float>(motion->yrel) * sdl.mouse.ysensitivity / 100.0f;
|
auto yrel = static_cast<float>(motion->yrel) * sdl.mouse.ysensitivity / 100.0f;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user