src/video/windows


Log

Author Commit Date CI Message
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
Sylvain 09ee811f 2022-12-01T09:39:08 Small format changed (using clang-format 15.0.2-1) (cherry picked from commit 778b8926b4808f0642a331ed84a9e8e19899b6db)
Sam Lantinga b8d85c69 2022-11-30T12:51:59 Update for SDL3 coding style (#6717) I updated .clang-format and ran clang-format 14 over the src and test directories to standardize the code base. In general I let clang-format have it's way, and added markup to prevent formatting of code that would break or be completely unreadable if formatted. The script I ran for the src directory is added as build-scripts/clang-format-src.sh This fixes: #6592 #6593 #6594 (cherry picked from commit 5750bcb174300011b91d1de20edb288fcca70f8c)
Sylvain Becker fb0ce375 2022-11-27T17:38:43 Cleanup add brace (#6545) * Add braces after if conditions * More add braces after if conditions * Add braces after while() conditions * Fix compilation because of macro being modified * Add braces to for loop * Add braces after if/goto * Move comments up * Remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements * More remove extra () in the 'return ...;' statements after merge * Fix inconsistent patterns are xxx == NULL vs !xxx * More "{}" for "if() break;" and "if() continue;" * More "{}" after if() short statement * More "{}" after "if () return;" statement * More fix inconsistent patterns are xxx == NULL vs !xxx * Revert some modificaion on SDL_RLEaccel.c * SDL_RLEaccel: no short statement * Cleanup 'if' where the bracket is in a new line * Cleanup 'while' where the bracket is in a new line * Cleanup 'for' where the bracket is in a new line * Cleanup 'else' where the bracket is in a new line (cherry picked from commit 6a2200823c66e53bd3cda4a25f0206b834392652 to reduce conflicts merging between SDL2 and SDL3)
Sylvain ddad901c 2022-11-17T10:43:45 Remove unneeded semicolon
Ryan C. Gordon 389ffab7 2022-11-16T12:53:48 Code style fixes, etc. Reference PR #6345.
ulatekh ec58a817 2022-10-05T19:26:09 Fixes made in response to running a static code analyzer under MS Windows. Most of these are probably harmless, but the changes to SDL_immdevice.c and SDL_pixels.c appear to have fixed genuine bugs. SDL_audiocvt.c: By separating the calculation of the divisor, I got rid of the suspicion that dividing a double by an integer led to loss of precision. SDL_immdevice.c: Added a missing test, one that could have otherwise led to dereferencing a null pointer. SDL_events.c, SDL_gamecontroller.c, SDL_joystick.c, SDL_malloc.c, SDL_video.c: Made it clear the return values weren't used. SDL_hidapi_shield.c: The size is zero, so nothing bad would have happened, but the SDL_memset() was still being given an address outside of the array's range. SDL_dinputjoystick.c: Initialize local data, just in case IDirectInputDevice8_GetProperty() isn't guaranteed to write to it. SDL_render_sw.c: drawstate.viewport could be null (as seen on line 691). SDL.c: SDL_MostSignificantBitIndex32() could return -1, though I don't know if you want to cope with that (what I did) or SDL_assert() that it can't happen. SDL_hints.c: Replaced boolean tests on pointer values with comparisons to NULL. SDL_pixels.c: Looks like the switch is genuinely missing a break! SDL_rect_impl.h: The MacOS static checker pointed out issues with the X comparisons that were handled by assertions; I added assertions for the Y comparisons. SDL_yuv.c, SDL_windowskeyboard.c, SDL_windowswindow.c: Checked error-result returns.
Hubert Maier 5dc93451 2022-11-06T20:49:37 JANITORIAL : Correct some more spelling mistakes (#6489)
Ryan C. Gordon 41d38c0f 2022-10-26T09:43:04 shape: More robust handling of failure cases in CreateShaper.
Ryan C. Gordon c8d20f96 2022-10-25T23:13:34 shape: Free platform-specific shaped window data. Fixes #2128.
Steven Noonan 053b5f85 2022-08-25T20:18:03 SDL_windowsevents: minimize white screen flash on window creation Clear the window to black on the initial window draw, to avoid a really obnoxious white flash. This doesn't always eliminate it, but it definitely minimizes it.
Sam Lantinga 61b5360e 2022-10-10T08:27:42 Only check to see if the ICC profile changes when the display changes or we gain focus Fixes https://github.com/libsdl-org/SDL/issues/6366
past-due 301912a5 2022-09-18T21:25:55 Fix: Use WIN_ClientPointToSDL for converting additional mouse coordinates
Ozkan Sezer c0baa6bf 2022-09-16T20:03:50 move SDL_windowstaskdialog.h contents into SDL_windowsmessagebox.c Silences clang -Wpragma warnings: D:/a/SDL/SDL/src/video/windows/SDL_windowstaskdialog.h:21:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] #include <pshpack1.h> ^ D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here #pragma pack(push,1) ^ In file included from D:/a/SDL/SDL/src/video/windows/SDL_windowsmessagebox.c:35: D:/a/SDL/SDL/src/video/windows/SDL_windowstaskdialog.h:156:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] #include <poppack.h> ^ note: previous '#pragma pack' directive that modifies alignment is here 2 warnings generated. Closes: https://github.com/libsdl-org/SDL/issues/6240
xeonmc 228b9fb5 2022-09-14T03:43:16 Update SDL_windowswindow.c (#6225) Clip rectangle set to int(left+width/2) , int(top+height/2) , int(left+width/2)+1 , int(top+height/2)+1 a 1x1 box On even-valued resolution, cursor is stable at bottom-right central pixel On odd-valued resolution, cursor is stable at exact central pixel. this is the desired behaviour
Mathieu Eyraud b8af865f 2022-08-28T13:02:57 Fix candidate list size for Windows IME Adjust candidate count so list is not draw bigger that needed. This also fix potential uninitialised read of variable `candsize[i]` if `vertical` is false.
Steven Noonan 9ce9c253 2022-08-25T18:41:32 SDL_windowsmodes: fix WIN_GetDisplayNameVista source identifier number This was getting the wrong monitor's name because the source identifier was not being included in the DisplayConfigGetDeviceInfo request.
DomGries 40b24992 2022-08-25T10:03:33 Fix building with SDL_DISABLE_WINDOWS_IME Regression of https://github.com/libsdl-org/SDL/commit/f317d619ccd22e60cebf1b09d716d3985359c981#diff-bff8f3e638d51e86cb6f0f42e2c527549d649951b7aa5ec4a539e865a5b57027R398
Noel Berry 00452e47 2022-08-24T11:25:13 Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112)
Sam Lantinga 92b3c53c 2022-08-22T16:25:25 Added a hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether to use system mouse acceleration on raw relative motion. This is currently only implemented on Windows, and "Enhanced pointer precision" mode is not quite correct.
Sam Lantinga ffab1396 2022-08-19T17:28:31 Fixed minimized window detection when handling WM_WINDOWPOSCHANGED When minimizing a window, we get this sequence of events: WM_WINDOWPOSCHANGING WM_GETMINMAXINFO WM_NCCALCSIZE WM_WINDOWPOSCHANGED - IsIconic() is true WM_MOVE WM_SIZE - SDL sees minimized state here When restoring a window, we get this sequence of events: WM_WINDOWPOSCHANGING WM_GETMINMAXINFO WM_NCCALCSIZE WM_NCPAINT WM_ERASEBKGND WM_WINDOWPOSCHANGED - IsIconic() is false WM_MOVE WM_SIZE - SDL sees restored state here On Windows 10 a minimized window has a non-empty client rect, so we were delivering a minimized size before SDL knows that the window is minimized, and then ignoring the restored size when handling the restore message. The fix is to use IsIconic() which returns the correct window state when WM_WINDOWPOSCHANGED is actually delivered.
Sam Lantinga be0cf257 2022-08-12T18:13:42 Only force the resize event in the DPI changed case OpenGL windows don't actually get the WM_WINDOWPOSCHANGED event in the SetWindowPos() call in WIN_SetWindowFullscreen(), so setting the window size to zero never gets reset and we're stuck with a zero sized window. Instead, just force the resize event in WM_DPICHANGED handling, where we know we need it. If we end up needing to force it in WIN_SetWindowFullscreen(), just set a flag in the window data and respond to that in WM_WINDOWPOSCHANGED, but that's a fairly risky behavior change as suddenly all applications would start getting SDL_WINDOWEVENT_SIZE_CHANGED when going fullscreen, and they may respond to that in expensive and potentially disruptive ways. For later we'll probably create a DPI changed event and respond to that in the renderer instead of this window size changed hack. This fixes https://github.com/libsdl-org/SDL/issues/6033 @ericwa
Sam Lantinga a1e34b5e 2022-08-11T08:52:51 Don't send a resize event when the window is resized to the dock icon Partially addresses https://github.com/libsdl-org/SDL/issues/6033
Ryan C. Gordon c6c0a839 2022-08-10T09:54:49 windows: If a display's friendly name is blank, try the generic name. Fixes #6031.
Sam Lantinga 98bac00d 2022-08-08T11:26:52 Add `SDL_GetPointDisplayIndex` and `SDL_GetRectDisplayIndex` and re-implement `SDL_GetWindowDisplayIndex` in terms of `SDL_GetRectDisplayIndex` - This allows looking up the display index for an arbitrary location rather than requiring an active window to do so. - This change also reimplements the fallback display lookup that found the display with center closest to the window's center to instead find the display rect edge closest to the window center (this was done in the almost identical display lookup used in SDL_windowsmodes.c, which now uses `SDL_GetPointDisplayIndex`). In practice this should almost never be hit as it requires the window's center to not be enclosed by any display rect.
Shootfast 60d1944e 2022-07-06T20:12:30 SDL_video: Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR
Sam Lantinga 602b7dd0 2022-08-01T17:47:26 Made the window ICMProfile filename per-window The event no longer spams each time a window gets focus if there are windows on monitors with different color profiles. This also has the side effect that you no longer get a color profile event at window creation, which is consistent with other events that communicate state changes.
Sam Lantinga cb107bef 2022-08-01T14:23:50 Fixed crash if all displays have been disconnected Fixes https://github.com/libsdl-org/SDL/issues/5867
Sam Lantinga 15bcf58d 2022-08-01T08:14:40 Fixed memory leak in the Windows driver
Cameron Gutman 8b438f7b 2022-07-31T15:34:03 keyboard: Only send SDL_KEYMAPCHANGED when the keymap actually changes
Ryan C. Gordon 20a76b0e 2022-07-25T23:06:58 video: removed unused devindex argument from bootstrap's create method.
Sam Lantinga 4d8bb89c 2022-07-24T11:50:14 Fixed mouse clip rect bounds on Windows Fixes https://github.com/libsdl-org/SDL/issues/5946
Sam Lantinga adf3ce7c 2022-07-05T21:42:24 Don't drop mouse focus on WM_MOUSELEAVE if the mouse is in relative mode; mouse-level is not meaningful for that case. Do drop mouse focus when keyboard focus is lost if the mouse is in relative mode.
Sam Lantinga 0253a450 2022-07-05T21:42:20 Fix format specifiers for WPARAM/LPARAM values, they are UINT_PTR.
rohlem b085c182 2022-07-04T16:38:05 make SDL_SetTextInputRect take a pointer to const The documentation doesn't state that the argument is ever modified, and no implementation does so currently. This is a non-breaking change to guarantee as much to callers.
chalonverse 85bbf8ee 2022-07-03T12:19:33 Fixed coment after #endif
chalonverse f317d619 2022-07-01T13:59:14 Xbox GDKX support (#5869) * Xbox GDK support (14 squashed commits) * Added basic keyboard testing * Update readme * Code review fixes * Fixed issue where controller add/removal wasn't working (since the device notification events don't work on Xbox, have to use the joystick thread to poll XInput)
chalonverse 3b191580 2022-06-27T17:19:39 Windows GDK Support (#5830) * Added GDK * Simplfied checks in SDL_config_wingdk.h * Added testgdk sample * Added GDK readme * Fixed error in merge of SDL_windows.h * Additional GDK fixes * OpenWatcom should not export _SDL_GDKGetTaskQueue * Formatting fixes * Moved initialization code into SDL_GDKRunApp
unknown 51c6488f 2022-06-26T18:47:34 Add support for SDL_render_d3d12.c to compile in C++ mode
Pieter-Jan Briers 9914e87f 2022-06-20T12:53:10 Also send DPI change when expected resize.
Pieter-Jan Briers af733c7a 2022-06-20T02:26:40 Fix DPI-raised SDL_WINDOWEVENT_SIZE_CHANGED with event callback. Move the sending of this event down so stuff like calling SDL_GL_GetDrawableSize() from a callback reports the new size instead of the old one.
Ozkan Sezer a8d41b3b 2022-06-18T21:51:32 check for shellscalingapi.h presence instead of WINVER >= 0x0603
Sam Lantinga a5949d7b 2022-06-15T23:00:28 Fixed crash on Windows These functions really are WINAPI
Ozkan Sezer 714502d3 2022-06-13T22:15:56 minor windows warning fixes.
Ryan C. Gordon 9a036767 2022-06-12T15:28:49 windows: Get better name for the physical display, for Vista and later. Fixes #5321.
Eric Wasylishen ab81a559 2022-06-07T02:01:27 Windows DPI scaling/highdpi support Adds hint "SDL_WINDOWS_DPI_SCALING" which can be set to "1" to change the SDL coordinate system units to be DPI-scaled points, rather than pixels everywhere. This means windows will be appropriately sized, even when created on high-DPI displays with scaling. e.g. requesting a 640x480 window from SDL, on a display with 125% scaling in Windows display settings, will create a window with an 800x600 client area (in pixels). Setting this to "1" implicitly requests process DPI awareness (setting SDL_WINDOWS_DPI_AWARENESS is unnecessary), and forces SDL_WINDOW_ALLOW_HIGHDPI on all windows.
Eric Wasylishen 448e05e3 2022-06-05T12:51:57 add DPI_AWARENESS_CONTEXT_UNAWARE_GDISCALED define
Eric Wasylishen 1b797957 2022-06-05T12:36:58 SDL_windowsvideo.c: add HIGHDPI_DEBUG ifdef, print DPI awareness at startup if defined document some additional quirks
Eric Wasylishen 1488c408 2022-06-05T12:01:32 WM_DPICHANGED: remove some dead code, add comment
Eric Wasylishen 60ef11b3 2022-06-03T00:21:36 Fix Watcom compile errors
Eric Wasylishen d3b970d4 2022-05-29T21:56:37 HighDPI: remove SWP_NOSIZE in WIN_SetWindowPosition If the move results in a DPI change, we need to allow the window to resize (e.g. AdjustWindowRectExForDpi frame sizes are different). - WM_DPICHANGED: Don't assume WM_GETDPISCALEDSIZE is always called for PMv2 awareness - it's only called during interactive dragging. - WIN_AdjustWindowRectWithStyle: always calculate final window size including frame based on the destination rect, not based on the current window DPI. - Update wmmsg.h to include WM_GETDPISCALEDSIZE (for WMMSG_DEBUG) - WIN_AdjustWindowRectWithStyle: add optional logging - WM_GETMINMAXINFO: add optional HIGHDPI_DEBUG logging - WM_DPICHANGED: fix potentially clobbering data->expected_resize Together these changes fix the following scenario: - launch testwm2 with the SDL_WINDOWS_DPI_AWARENESS=permonitorv2 environment variable - Windows 10 21H2 (OS Build 19044.1706) - Left (primary) monitor: 3840x2160, 125% scaling - Right (secondary) monitor: 2560x1440, 100% scaling - Alt+Enter, Alt+Enter (to enter + leave desktop fullscreen), Alt+Right (to move window to right monitor). Ensure the window client area stays 640x480. Drag the window back to the 125% monitor, ensure client area stays 640x480.
Eric Wasylishen 51ebefee 2022-02-28T00:43:43 Support PMv2 DPI awareness, add SDL_HINT_WINDOWS_DPI_AWARENESS The hint allows setting a specific DPI awareness ("unaware", "system", "permonitor", "permonitorv2"). This is the first part of High-DPI support on Windows ( https://github.com/libsdl-org/SDL/issues/2119 ). It doesn't implement a virtualized SDL coordinate system, which will be addressed in a later commit. (This hint could be useful for SDL apps that want 1 SDL unit = 1 pixel, though.) Detecting and behaving correctly under per-monitor V2 (calling AdjustWindowRectExForDpi where needed) should fix the following issues: https://github.com/libsdl-org/SDL/issues/3286 https://github.com/libsdl-org/SDL/issues/4712
Guldoman f78f7752 2022-05-28T03:53:43 ime: windows: allocate space for null terminator
Simon McVittie 412ceb84 2022-05-24T16:27:54 video: Only check major version in SDL_GetWindowWMInfo Since #5602, SDL is intended to have the same ABI across the whole major-version 2 cycle, so we should not check that the minor version matches the one that was used to compile an application. There are two checks that could make sense here. The first check is that the major version matches the expected major version. This is usually unnecessary and is not usually done (if we're calling into the wrong library we'll likely crash anyway), but since we have the information, we might as well continue to use it. The second check is whether the version provided by the caller is equal to or greater than a threshold version at which additional fields were added to the struct. If it is, we should populate those fields; if it is not, then we cannot. This is only useful on platforms where additional fields have genuinely been added during the lifetime of SDL 2, like Windows and DirectFB (but not X11). This commit changes the first check to be consistent about only looking at the minor version, while leaving the second check using SDL_VERSIONNUM (which will be removed or widened in SDL 3, but it's fine for now). Resolves: https://github.com/libsdl-org/SDL/issues/5711 Fixes: cd7c2f1 "Switch versioning scheme to be the same as GLib and Flatpak" Signed-off-by: Simon McVittie <smcv@collabora.com>
Cameron Cawley b798e49c 2022-05-19T21:44:38 Fix build warning with MSVC
Cameron Cawley 9dfa000b 2022-05-18T20:20:03 Initial support for building for Windows with OpenWatcom
Cameron Cawley c8eea020 2022-05-18T21:14:20 Fix C89 build errors in Windows builds
Cameron Cawley 0cca71a8 2022-05-18T22:12:05 Use SDLCALL for callbacks in public APIs
Sam Lantinga 9919d1a7 2022-04-18T11:51:09 Remove HWND_TOPMOST for fullscreen windows Fixes https://github.com/libsdl-org/SDL/issues/5509
Sam Lantinga 268c2fa8 2022-04-05T18:42:17 Don't resize fullscreen windows when hiding or minimizing them (thanks @madewokherd!) This has the benefit of window previews (mousing over the icon) having the correct size and contents. Fixes https://github.com/libsdl-org/SDL/issues/5320
Esme Povirk def27267 2022-02-05T12:32:06 Ignore focus change messages that contradict GetForegroundWindow. On Wine, when a window is programmatically minimized in response to losing focus, we receive a WM_ACTIVATE for the deactivation, but GetForegroundWindow still indicates that our window is focused. This causes an incorrect SDL_WINDOWEVENT_FOCUS_GAINED. This is probably a Wine bug, but it may take a while to fix and then for the fix to make its way to users.
Sam Lantinga 6c962177 2022-03-18T10:07:59 Added the hint SDL_HINT_MOUSE_RELATIVE_MODE_CENTER, controlling whether the mouse should be constrained to the center of the window or the whole window in relative mode. For further info about the pros and cons, check out the discussion in https://github.com/libsdl-org/SDL/issues/5271
Sam Lantinga 3167ba34 2022-03-17T17:58:35 Fixed freeing the Windows blank cursor
Sam Lantinga 0387bf82 2022-03-17T17:55:28 Fixed memory leak in WIN_CreateBlankCursor()
Sam Lantinga d4062785 2022-03-17T17:01:36 Try not forcing activation when grabbing the mouse in fullscreen windows
Sam Lantinga 4e784fce 2022-03-17T16:57:33 When updating grab state, only activate windows that are grabbed, fullscreen, and shown. Fixes https://github.com/libsdl-org/SDL/issues/5371
Sam Lantinga e5f45455 2022-03-17T14:44:34 Added a hint to mark a foreign window as usable with OpenGL Fixes https://github.com/libsdl-org/SDL/issues/2942
Sam Lantinga 4e49b78a 2022-03-17T14:44:17 Fixed compile warning and comment typo
Esme Povirk 829e15a4 2022-02-05T14:38:39 Ignore unknown WM_SIZE types. According to MSDN, we can also get SIZE_MAXHIDE and SIZE_MAXSHOW, based on state changes to other windows. It's not clear under what circumstances this will happen (I saw some docs indicating it may require multiple application windows), but it doesn't seem right to treat them as RESTORED.
Ozkan Sezer d1e4367f 2022-03-15T21:41:02 SDL_windowskeyboard.c: fix build with SDL_DISABLE_WINDOWS_IME defined. Fixes https://github.com/libsdl-org/SDL/issues/5408
Zach Reedy 363c3678 2022-03-10T17:12:33 Fixed: Incorrect assumption that mouse button is released when window is allocated
Ozkan Sezer 072db7b0 2022-03-12T01:56:40 SDL_windowskeyboard.c (IME_IsTextInputShown): remove unused local vars.
Zach Reedy d14a1263 2022-03-11T17:45:17 IME Composition Truncation + SDL_IsTextInputShown + SDL_ClearComposition (#5398) * Fixes for IME Composition Truncation + Addition of SDL_ClearComposition, SDL_IsTextInputShown * Fixed: Documentation and code style issues raised during code review.
Jo Bates 01d38e7a 2022-03-09T14:03:52 Make Win32 fullscreen and borderless windows minimizable
pionere 97269e14 2022-01-18T17:51:17 adjustments to ime_candidates - allocate ime_candidates on demand - allow write to the whole allocated memory of ime_candidates - ensure ime_candcount is set to zero in case the candidates can not be queried for any reason
pionere 6f404d0f 2022-01-18T17:49:33 cleanup IME_GetCandidateList / UILess_GetCandidateList - move IME_ShowCandidateList, ImmGetContext and ImmReleaseContext to this function - set ime_candpgsize to MAX_CANDLIST if dwPageSize is zero - comment out deselection of ime_candsel in case of korean language for the moment (LANG_CHT does not work anyway)
pionere 32c7d5d3 2022-01-18T17:44:51 cleanup IME_UpdateInputLocale - do not store the HKL in a static variable - always set the ime_candvertical value in case the HKL is changed
pionere 25aa7244 2022-01-18T17:43:31 cleanup IME_GetId - use assert instead of a check (it is a static function with constant parameter) - assume it is called with 0 first (simplifies the logic) - reuse dwLang value instead of a new 'call' to LANG()
pionere 3c85cef4 2022-01-17T09:58:16 cleanup SDL_RegisterApp - fix memory leak when RegisterClassEx fails - set style according to the documentation - eliminate duplicated SDL_Instance setter
pionere 014e2bbd 2022-01-12T16:40:52 use SDL_COMPILE_TIME_ASSERT instead of SDL_STATIC_ASSERT
pionere 942b01a5 2022-01-09T15:08:21 do not use RWOps in WIN_SetWindowIcon
ulatekh 57bc9040 2022-01-07T08:54:08 Add hint to optionally forcibly raise the window under MS Windows.
ulatekh d7873e65 2022-01-04T15:47:29 Disable tablet flicks under MS Windows.
ulatekh 53df0e66 2022-01-21T17:15:18 Fix the erroneous generation of mouse-down events from touch-move events. The issue is that MS Windows synthesizes a mouse-move event in response to touch-move events, and those mouse-move events are NOT labeled as coming from a touch (e.g. GetMouseMessageSource() will not return SDL_MOUSE_EVENT_SOURCE_TOUCH for those synthesized mouse-move events). In addition, there seems to be no way to prevent this from happening; https://gist.github.com/vbfox/1339671 claims to demonstrate a technique to prevent it, but in my experience, it doesn't work. Because of this, the "fallthrough" case can't test that the synthesized mouse-move came from a touch-move, and starts erroneously pressing down the mouse-button, leading to massive confusion in the client application.
Sam Lantinga 1085c317 2022-01-07T16:43:53 Use the requested cursor size instead of the default cursor size CopyImage() will scale based on the system accessibility settings automatically. Fixes https://github.com/libsdl-org/SDL/issues/5198
Sam Lantinga 957c48b4 2022-01-07T10:58:04 Fixed detecting focus change to child dialogs Fixes https://github.com/libsdl-org/SDL/issues/5157
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Sam Lantinga 8f816998 2021-12-31T08:46:54 Only clear IME display options if SDL_HINT_IME_SHOW_UI is off (thanks opxdo!) Fixes https://github.com/libsdl-org/SDL/issues/5153
Sam Lantinga ca18bf11 2021-12-16T12:01:18 Don't compare raw mouse button state with windows message button state When mouse buttons are swapped, right mouse button down is the same value as raw mouse button up, and conceptually the two systems use different button masks, so never cache state between the two. Fixes https://github.com/libsdl-org/SDL/issues/5108
Hanseul Jun e7f84c20 2021-12-09T10:40:53 Fix a typo in comment.
Cameron Gutman 715d4812 2021-11-29T22:43:25 windows: Fix GUI key state when grabbing the keyboard When our keyboard grab hook is installed, GetKeyState() will return 0 for the GUI keys even when they are pressed. This leads to spurious key up events when holding down the GUI keys and the inability to use any key combos involving those modifier keys.
Sam Lantinga 942973dd 2021-11-28T09:27:28 Use mouse ID 0 for raw mouse events We don't track state for each mouse individually, so we should just use the global mouse ID for all events. Fixes https://github.com/libsdl-org/SDL/issues/5026
Ozkan Sezer 8a6e48d4 2021-11-14T04:40:50 constified SDL_RegisterApp()
Misa 3bf7994f 2021-09-27T14:38:12 Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Clang before Clang 10 and GCC before GCC 7 have problems with using __attribute__ as a sole statement and warn about a "declaration not declaring anything", so fall back to using the /* fallthrough */ comment if we are using those older compiler versions. Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.
Sam Lantinga abc12a83 2021-11-11T15:58:44 Revert "Add and use `SDL_FALLTHROUGH` for fallthroughs" This reverts commit 66a08aa3914a98667f212e79b4f0b9453203d656. This causes problems with older compilers: https://github.com/libsdl-org/SDL/pull/4791#issuecomment-966630997
Misa 66a08aa3 2021-09-27T14:38:12 Add and use `SDL_FALLTHROUGH` for fallthroughs Case fallthrough warnings can be suppressed using the __fallthrough__ compiler attribute. Unfortunately, not all compilers have this attribute, or even have __has_attribute to check if they have the __fallthrough__ attribute. [[fallthrough]] is also available in C++17 and the next C2x, but not everyone uses C++17 or C2x. So define the SDL_FALLTHROUGH macro to deal with those problems - if we are using C++17 or C2x, it expands to [[fallthrough]]; else if the compiler has __has_attribute and has the __fallthrough__ attribute, then it expands to __attribute__((__fallthrough__)); else it expands to an empty statement, with a /* fallthrough */ comment (it's a do {} while (0) statement, because users of this macro need to use a semicolon, because [[fallthrough]] and __attribute__((__fallthrough__)) require a semicolon). Applications using SDL are also free to use this macro (because it is defined in begin_code.h). All existing /* fallthrough */ comments have been replaced with this macro. Some of them were unnecessary because they were the last case in a switch; using SDL_FALLTHROUGH in those cases would result in a compile error on compilers that support __fallthrough__, for having a __attribute__((__fallthrough__)) statement that didn't immediately precede a case label.
Sam Lantinga fed85778 2021-11-10T08:47:39 Update the orientation and display modes when the display settings change on Windows Fixes https://github.com/libsdl-org/SDL/issues/1061
Sam Lantinga c0f1109b 2021-11-10T06:03:01 Implemented querying the orientation of displays on Windows
Susko3 1fc25bd8 2021-11-08T22:04:34 Properly position the IME window(s) on windows
Yufei Huang 881f747d 2021-11-09T13:35:18 Always destroy icon