mirror of
https://github.com/Ryujinx/SDL.git
synced 2024-12-24 12:15:37 +00:00
Fixed bug 4265 - SDL window falls to the bottom of the screen when dragged down and stuck there
Alexei On WM_WINDOWPOSCHANGED event, WIN_UpdateClipCursor() is called. SDL_WINDOW_INPUT_FOCUS is set even when the mouse pointer is not inside the SDL window and therefore ClipCursor(&rect) is called. When dragging the window and rect.bottom=800 (i.e. the bottom edge of the screen) the SDL window is clipped to the bottom of the screen and it is not possible to move it back to the center of the screen.
This commit is contained in:
parent
ffc19ee255
commit
55b24b93b4
|
@ -414,6 +414,13 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
|||
}
|
||||
break;
|
||||
|
||||
case WM_NCACTIVATE:
|
||||
{
|
||||
/* Don't immediately clip the cursor in case we're clicking minimize/maximize buttons */
|
||||
data->skip_update_clipcursor = SDL_TRUE;
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_ACTIVATE:
|
||||
{
|
||||
POINT cursorPos;
|
||||
|
|
|
@ -904,7 +904,11 @@ WIN_UpdateClipCursor(SDL_Window *window)
|
|||
SDL_Mouse *mouse = SDL_GetMouse();
|
||||
RECT rect;
|
||||
|
||||
if (data->focus_click_pending) {
|
||||
if (data->in_title_click || data->focus_click_pending) {
|
||||
return;
|
||||
}
|
||||
if (data->skip_update_clipcursor) {
|
||||
data->skip_update_clipcursor = SDL_FALSE;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,6 +44,7 @@ typedef struct
|
|||
SDL_bool in_border_change;
|
||||
SDL_bool in_title_click;
|
||||
Uint8 focus_click_pending;
|
||||
SDL_bool skip_update_clipcursor;
|
||||
SDL_bool windowed_mode_was_maximized;
|
||||
SDL_bool in_window_deactivation;
|
||||
RECT cursor_clipped_rect;
|
||||
|
|
Loading…
Reference in a new issue