Skip to content

Commit

Permalink
fix WIN_WindowProc in SDL
Browse files Browse the repository at this point in the history
  • Loading branch information
xianjimli committed Apr 10, 2019
1 parent 10c5a02 commit 65e3fbe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 3rd/SDL/src/video/windows/SDL_windowsevents.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,8 +584,8 @@ WIN_WindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
GetClientRect(hwnd, &hwndRect);

/* if in the window, WM_MOUSEMOVE, etc, will cover it. */
if(currentHnd != hwnd || pt.x < 0 || pt.y < 0 || pt.x > hwndRect.right || pt.y > hwndRect.right) {
SDL_SendMouseMotion(data->window, 0, 0, (int)pt.x, (int)pt.y);
if(currentHnd != hwnd || pt.x < 0 || pt.y < 0 || pt.x > hwndRect.right || pt.y > hwndRect.bottom) {
SDL_SendMouseMotion(data->window, 0, 0, (int)pt.x/data->window->dpi_ratio, (int)pt.y/data->window->dpi_ratio);
SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_LBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_LEFT);
SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_RBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_RIGHT);
SDL_SendMouseButton(data->window, 0, GetAsyncKeyState(VK_MBUTTON) & 0x8000 ? SDL_PRESSED : SDL_RELEASED, SDL_BUTTON_MIDDLE);
Expand Down
3 changes: 3 additions & 0 deletions docs/changes.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# 最新动态
* 2019/04/10
* 更新demo,增加back\_to\_home的demo。
* 修改SDL的BUG(感谢大恒和陈谭提供补丁)

* 2019/04/09
* 修改window\_manager\_back\_to\_home。
Expand Down

0 comments on commit 65e3fbe

Please sign in to comment.