Sam Lantinga
67c42cb44c
Fixed Windows build
2021-11-08 22:16:01 -08:00
Sam Lantinga
fd79607eb0
Added SDL_GetWindowMouseRect()
...
Also guarantee that we won't get mouse movement outside the confining area, even if the OS implementation allows it (e.g. macOS)
2021-11-08 21:34:48 -08:00
Sam Lantinga
4db546b092
Implemented SDL_SetWindowMouseRect() on macOS
2021-11-08 20:35:56 -08:00
Sam Lantinga
2d23d66a61
Fixed SetWindowMouseRect return value on Windows
2021-11-08 16:33:50 -08:00
Sam Lantinga
7d21322df1
Implemented SDL_SetWindowMouseRect() on Windows
2021-11-08 16:29:19 -08:00
Yufei Huang
301819cd1d
SDL_windowsmouse.c: Fix WIN_CreateCursor does not scale with system cursor size preference
2021-11-08 06:59:36 -08:00
Sam Lantinga
2248a54937
Update the focus in case we changed focus to a child window and then away from the application
...
In this case we'll get WM_KILLFOCUS when the child window is focused, but we'll retain focus on the top level window, but when we Alt-Tab away, we won't get another WM_KILLFOCUS or WM_NCACTIVATE, we get WM_ACTIVATE instead, so we need to check for focus updates in response to that as well.
2021-11-05 22:52:18 -07:00
Cacodemon345
19dee1cd16
Add SDL_GetWindowICCProfile(). ( #4314 )
...
* Add SDL_GetWindowICCProfile
* Add new SDL display events
* Implement ICC profile change event for macOS
* Implement ICC profile notification for Windows
* Fix SDL_GetWindowICCProfile() for X11
* Fix compile errors
2021-10-21 17:37:20 -07:00
Sam Lantinga
bfd2f8993f
Fixed grab handling when focus changes between windows in the same application
2021-10-19 17:29:23 -07:00
Sam Lantinga
7fb4364391
Don't process WM_INPUT when handling relative mode by warping the mouse cursor
2021-10-17 13:56:31 -07:00
DomGries
06824b18fd
Cleanup windows events after recent changes
...
Improves clarity without any functional changes
2021-10-17 13:36:42 -07:00
Sam Lantinga
a70a94e0b3
Don't send a mouse leave event if the mouse is outside the window when gaining focus and in relative mode.
2021-10-15 18:11:19 -07:00
Ozkan Sezer
c583055acb
SDL_windowsevents.c (WIN_WindowProc): remove SAFE_AREA_X and SAFE_AREA_Y
...
Not used since commit a1fabca162
2021-10-15 10:11:24 +03:00
Sam Lantinga
a1fabca162
Removed mouse warping for local mice and improved warp handling for mouse over RDP
2021-10-14 16:52:21 -07:00
Sam Lantinga
5e89b3c89e
Don't need to use raw input to track the mouse during mouse capture (thanks Brick!)
2021-10-14 11:46:07 -07:00
Brick
0b6a821188
Messages posted on the same tick are not new
2021-10-14 09:05:38 -07:00
Rémy Tassoux
0789610cfb
Add SDL_HINT_WINDOW_NO_ACTIVATION_WHEN_SHOWN
2021-10-14 08:39:48 -07:00
Ozkan Sezer
6149e60136
remove IsWin10FCUorNewer() -- not used since commit 40ed9f75c9
2021-10-13 00:03:56 +03:00
Ozkan Sezer
311671a029
fixed build after commit 6e356e20ad
2021-10-12 23:50:02 +03:00
Rémy Tassoux
6e356e20ad
Fix mouse focus being set to null when a captured mouse cursor leaves the window.
2021-10-12 13:30:46 -07:00
Sam Lantinga
40ed9f75c9
Workaround for Windows occasionally ignoring SetCursorPos() calls
...
Also, since we're flushing mouse motion before and including the warp, we don't need the isWin10FCUorNewer hack to simulate mouse warp motion.
Fixes https://github.com/libsdl-org/SDL/issues/4339 and https://github.com/libsdl-org/SDL/issues/4165
2021-10-08 10:05:27 -07:00
Sam Lantinga
16aeb8d0f5
Guarantee that we don't dispatch any mouse motion from before or including the last mouse warp
2021-10-07 15:04:06 -07:00
Sam Lantinga
649466f491
Flush any pending mouse motion when warping the mouse cursor
...
Fixes https://github.com/libsdl-org/SDL/issues/4165
2021-10-07 13:28:44 -07:00
Sam Lantinga
dd95c9c8a2
Moved focus click check into WIN_UpdateFocus() so we have the correct state when setting keyboard focus
...
Fixes https://github.com/libsdl-org/SDL/issues/4817
2021-10-06 09:09:39 -07:00
DomGries
0d541e5a88
Revert "Fixed relative mode mouse events stopping if you click on the title bar"
...
This has been better fixed by b28ed02 or another related relative mouse mode change of @slouken in SDL 2.0.17 and as such can be reverted to reduce unneeded processing in WM_MOUSEMOVE
2021-10-05 15:46:12 -07:00
Sam Lantinga
c542de9213
React to WM_NCACTIVATE instead of WM_SETFOCUS or WM_ACTIVATE for focus changes
...
See https://github.com/libsdl-org/SDL/pull/4293 and https://github.com/libsdl-org/SDL/issues/4450 for details
2021-10-05 14:09:52 -07:00
Sam Lantinga
632aca2945
Window input focus is based on WM_SETFOCUS and WM_KILLFOCUS as WM_ACTIVATE doesn't necessarily imply focus.
...
Hopefully resolves https://github.com/libsdl-org/SDL/issues/4450 and https://github.com/libsdl-org/SDL/pull/4293
2021-10-01 16:17:38 -07:00
Sam Lantinga
477fcf52e9
Fixed whitespace
2021-09-24 10:49:46 -07:00
Sam Lantinga
db68af8032
Reduce the likelyhood that the mouse will hover over the taskbar or toast notification while in relative mode, which causes a mouse leave event.
...
This will still happen occasionally as the mouse is whipped around, if there is a window overlapping the game window, but it should happen less often now. This could even happen with the original code that warped the mouse every frame, so this should be a good compromise where we don't warp the mouse continously and we still keep the mouse in the safe area of the game window.
Note that notifications can be any size, so the safe area may need to be adjusted or even dynamically defined via a hint.
2021-09-24 10:49:44 -07:00
Sam Lantinga
287571fb46
Limit effect of in_title_click and focus_click_pending to only blocking cursor warping; without this all relative mouse motion was getting ignored when a window was activated via a mouse button
2021-09-22 17:40:57 -07:00
Sam Lantinga
5d455cabf9
Don't process raw input when the window is being dragged or clicked on.
2021-09-21 18:15:11 -07:00
Sam Lantinga
0fd54f91f4
Fixed using a tablet with raw input relative motion
...
Tested with a Wacom Cintiq Pro 16"
2021-09-21 18:15:11 -07:00
Sam Lantinga
8fee82d1fd
Improve relative motion handling over RDP
...
CR and research: @danielj
2021-09-21 18:15:09 -07:00
Zach Reedy
2a8938f2bf
Fixed: Whitespace being striped from the end of IME strings incorrectly + Regression with SDL_SetTextInputRect ( #4752 )
...
* Fixed: Whitespace being striped from the end of IME strings incorrectly
* Fixed: Google IME Candidate Window not placing correctly
* Why are PostBuild events stored in the vcxproj and not a user file?
* Revert SDL.vcxproj properly...
* Remove whitespace as per code review
* Fix Werror=declaration-after-statement error in code
2021-09-15 09:40:22 -07:00
Zach Reedy
6f97205229
Added: Support for showing the IME Candidate Window on Windows
2021-09-02 02:28:54 -10:00
Ozkan Sezer
ccb06296b9
SDL_windowsevents.c: fix build against older SDKs.
2021-08-19 03:15:02 +03:00
Sam Lantinga
91a55a02de
Relative mouse motion is delivered to the window with keyboard focus
...
This was the original intent (note SDL_UpdateWindowGrab() in SDL_OnWindowFocusGained() and SDL_OnWindowFocusLost()) and fixes a bug where relative motion unexpectedly stops if the task bar is covering the bottom of the game window and the mouse happens to move over it while relative mode is enabled.
Another alternative would be to confine the mouse when relative mode is enabled, but that generates mouse motion which would need to be ignored, and it's possible for the user moving the mouse to combine with the mouse moving into the confined area so you can't easily tell whether to ignore the mouse motion. See https://github.com/libsdl-org/SDL/issues/4165 for a case where this is problematic.
2021-08-14 00:00:57 -07:00
Sam Lantinga
4d9efcb55c
Fixed flag test for boolean correctness
2021-08-13 11:52:25 -07:00
Sam Lantinga
b28ed02803
Don't warp the mouse for relative mode when the window doesn't have focus
2021-08-13 11:39:41 -07:00
Sam Lantinga
cb1e20b058
Added KMOD_SCROLL to track the scroll lock state
...
Fixes https://github.com/libsdl-org/SDL/issues/4566
2021-08-10 17:50:17 -07:00
hgs3
cb0fd05eeb
Adding a clarifying comment in case a programmer unfamiliar with UTF-16 and UTF-32's relationship chances upon the code.
2021-08-10 12:07:11 -07:00
Henry G. Stratmann III
3470112969
Optimizing the implementation.
2021-08-10 12:07:11 -07:00
Henry G. Stratmann III
712e0d1f06
Fixing WM_CHAR event handling for Unicode characters outside the Basic Multilingual Plane.
2021-08-10 12:07:11 -07:00
Ryan C. Gordon
cc4ab10195
windows: convert "//" comment to "/**/", add a FIXME.
...
Reference #4129
Reference #4177
2021-07-28 14:37:33 -04:00
Sam Lantinga
41e1a2360f
Correct the maximized size and position for borderless resizable windows
...
This fixes bug https://github.com/libsdl-org/SDL/issues/4043
2021-07-27 16:51:08 -07:00
Sam Lantinga
3b85e3fdfc
Fixed internal Windows key state when using Windows+Space or Windows+G shortcuts
...
This fixes bugs:
https://github.com/libsdl-org/SDL/issues/4369
https://github.com/libsdl-org/SDL/issues/4500
2021-07-24 15:47:11 -07:00
Sam Lantinga
f1633127d1
Added a window flash operation to be explicit about window flash behavior
2021-07-24 13:42:19 -07:00
Sam Lantinga
e1c3a25034
Changed SDL_FlashWindow() so it doesn't take a flash count, and added the hint SDL_HINT_WINDOW_FLASH_COUNT to control behavior on Windows
2021-07-24 12:11:27 -07:00
Brick
7fe6dbafa3
Reset rawInputEnableCount when RawInput is not supported
2021-07-11 14:51:31 -07:00
Hanseul Jun
557d0f827f
Commenting a false alarm in WIN_GLES_SetupWindow.
...
When hint SDL_HINT_OPENGL_ES_DRIVER is set to "1" (e.g. for ANGLE support), assertion due to !_this->gl_config.driver_loaded can be causes while EGL is available.
2021-07-08 14:49:40 -07:00