2313 Commits

Author SHA1 Message Date
Ethan Lee
5655be1558 wayland: Avoid overwriting xdg_output position with wl_output position 2022-03-26 19:57:39 -04:00
Ethan Lee
40417b188a wayland: Work around a GNOME xdg_output scaling issue 2022-03-26 19:55:04 -04:00
Ethan Lee
7a1c45bd1c wayland: Optimize keyboard_handle_modifiers.
1. Mod index values are (mostly) constant, so can be done with xkb_state_new
2. Mods can change without the group changing, avoid remap events if possible

Lastly, as a bonus, I added braces to the locale check, because I was nearby.
2022-03-25 12:54:05 -04:00
Sylvain
bf38fd4679
YUV: fix invalid read on last line when converting from SDL_PIXELFORMAT_YUY2 (see bug #4841) 2022-03-25 11:52:50 +01:00
Ethan Lee
2891f0821b wayland: Use xkb_keymap_mod to set mod state 2022-03-25 02:49:49 -04:00
Ethan Lee
6d9ca92626 wayland: Enforce text capitalization manually, for remapped keymods 2022-03-25 01:36:39 -04:00
Ethan Lee
a75c6150e0 wayland: Add an xkb_keysym_t->SDL_Keycode mapping for backspace 2022-03-25 01:33:40 -04:00
Ethan Lee
ab74b6a3c3 wayland: Remove some now-redundant casts 2022-03-24 15:34:29 -04:00
Ethan Lee
ee52ad08cd wayland: Minor fixes for old compilers 2022-03-24 15:32:25 -04:00
Simon McVittie
b4d28085bf wayland: Don't overwrite error message from SDL_EGL_CreateSurface
SDL_EGL_CreateSurface sets a more specific error message, so overwriting
it would lose information.

Signed-off-by: Simon McVittie <smcv@collabora.com>
2022-03-24 14:59:25 -04:00
Simon McVittie
d5bbbd3f73 Avoid depending on libwayland 1.20 unnecessarily
When using shared linking (linking in the normal way with
-lwayland-client) rather than loading Wayland libraries dynamically at
runtime, listing symbols that don't exist in the current version results
in a build failure. We don't actually call wl_proxy_marshal_flags() or
wl_proxy_marshal_array_flags() directly; the reason we need them is
that they're called by the code generated by wayland-scanner >= 1.20.

If we're building against an older Wayland library, then we'll have its
corresponding version of wayland-scanner (mismatched versions are not
supported), so we won't need those two symbols, and can avoid generating
a dependency on them.

Conversely, if we're building against a newer Wayland library, the
generated code will call them unconditionally, so we cannot treat them as
optional and gracefully fall back: that would result in a crash. Instead,
treat them as a mandatory part of the Wayland library, so that if they
are not found at runtime, we can fall back to X11 without crashing.

libwayland 1.18 is in several LTS distributions (Ubuntu 20.04,
Debian 11, RHEL 8) so avoiding a hard dependency on 1.20 is quite
useful.

Signed-off-by: Simon McVittie <smcv@collabora.com>
Resolves: https://github.com/libsdl-org/SDL/issues/5376
2022-03-24 14:46:48 -04:00
Ryan C. Gordon
d597a9b431
x11: Minor cleanups and corrections in X11_ShowMessageBox.
Reference issue #3254.
2022-03-24 14:25:34 -04:00
Sylvain
6c56193a2a
Fixed bug #1650: X11 doesn't set KMOD_NUM and KMOD_CAPS to system state 2022-03-24 18:09:45 +01:00
Ryan C. Gordon
4fe7b2cbd1
static analysis: Fixed several complaints from codechecker.
There are still some pending Objective-C specific issues.

Reference issue #4600.
2022-03-24 11:00:43 -04:00
Frank Praznik
0dae35bf3d video: wayland: Use xdg-output for retrieving the desktop dimensions
Using wl-output to get the desktop display dimensions and dividing by the integer scale factor will not return the correct result when using a desktop with fractional scaling (e.g. a 3840x2160 display at 150% will incorrectly report the scaled desktop area as 1920x1080 instead of 2560x1440).  Use the xdg-output protocol, if available, to retrieve the correct desktop dimensions and offset.

Versions 1 through 3 of the protocol are supported.
2022-03-23 19:43:11 -04:00
Florian "sp1rit"​
9125b244e7 wayland: Basic support for zwp_tablet_*v2 protocol 2022-03-23 13:47:46 -04:00
Ethan Lee
13337e17a5 wayland: The rest of the wayland-client 1.18 requirement... Git, please 2022-03-23 13:27:01 -04:00
Sylvain
f5a980448e
Android: add SetWindowResizable() implementation
- which also enable/disable the orientation lock status.

This is only provided when the window is not SDL_WINDOW_FULLSCREEN (see SDL_video.c).
Final orientation also depends on SDL_HINT_ORIENTATIONS.
2022-03-23 10:13:56 +01:00
Charlie Birks
4b8d69a416 Avoid trying to use texture framebuffers on emscripten 2022-03-22 12:18:45 -07:00
Sam Lantinga
34fd83ca06 Don't try to hide foreign windows when destroying the SDL window representation
Fixes https://github.com/libsdl-org/SDL/issues/5432
2022-03-22 06:50:10 -07:00
Ozkan Sezer
74680f5c4c regenerated SDL_blit_auto.c. 2022-03-22 00:56:28 +03:00
pionere
dd6c46cb34 blit-auto optimizations 2022-03-22 00:56:28 +03:00
Sam Lantinga
8f964576da Fixed parameter operation ordering for ease of reading 2022-03-19 11:01:55 -07:00
Sam Lantinga
0517b61ed6 Relative mouse mode is tied to the window with keyboard focus
This isn't obvious, but makes sense when thinking about how games actually use it. This is also in line with how Windows mouse relative mode is implemented.

Fixes https://github.com/libsdl-org/SDL/issues/5340
2022-03-19 11:00:00 -07:00
Ryan C. Gordon
d81fee7623
SDL_Rect: Added floating point versions of all the rectangle APIs.
Fixes #5110.
2022-03-19 10:35:24 -04:00
Ryan C. Gordon
4d9bef604a
SDL_Rect: minor code cleanups. 2022-03-19 10:35:23 -04:00
Ryan C. Gordon
c573ebe143
SDL_UnionRect: If both rects are empty, zero out the result struct. 2022-03-19 10:35:23 -04:00
Sam Lantinga
6c96217727 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
2022-03-18 10:07:59 -07:00
Sam Lantinga
3167ba342d Fixed freeing the Windows blank cursor 2022-03-17 17:58:35 -07:00
Sam Lantinga
0387bf821a Fixed memory leak in WIN_CreateBlankCursor() 2022-03-17 17:55:28 -07:00
Sam Lantinga
d406278513 Try not forcing activation when grabbing the mouse in fullscreen windows 2022-03-17 17:01:36 -07:00
Sam Lantinga
4e784fce43 When updating grab state, only activate windows that are grabbed, fullscreen, and shown.
Fixes https://github.com/libsdl-org/SDL/issues/5371
2022-03-17 16:57:33 -07:00
Sam Lantinga
e5f45455c9 Added a hint to mark a foreign window as usable with OpenGL
Fixes https://github.com/libsdl-org/SDL/issues/2942
2022-03-17 14:44:34 -07:00
Sam Lantinga
4e49b78a11 Fixed compile warning and comment typo 2022-03-17 14:44:17 -07:00
Ethan Lee
0bf8ccfb60 video: Add a hint to allow Vulkan surfaces on foreign windows 2022-03-17 14:25:55 -07:00
Esme Povirk
829e15a490 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.
2022-03-17 12:51:46 -07:00
uyjulian
a164c9d245 SDL_cocoawindow.m: update fullscreen toggle when SDL_SetWindowResizable called 2022-03-17 12:35:57 -07:00
Sylvain
93e7caab9a
SDL_blit_slow: remove one nested 'if()' because of ARGB2101010 handling 2022-03-16 18:08:20 +01:00
Sylvain
56568ffb38
Remove 'reserved identifier' warning 2022-03-16 18:04:40 +01:00
Ozkan Sezer
d1e4367f58 SDL_windowskeyboard.c: fix build with SDL_DISABLE_WINDOWS_IME defined.
Fixes https://github.com/libsdl-org/SDL/issues/5408
2022-03-15 21:41:02 +03:00
Sylvain
f3e86b9fd3
Fixed bug #2199: make SDL_blit_slow handles SDL_PIXELFORMAT_ARGB2101010, storing as RGBA 2022-03-15 17:46:12 +01:00
Zach Reedy
363c36781d Fixed: Incorrect assumption that mouse button is released when window is allocated 2022-03-14 08:38:25 -07:00
Guus Waals
7495b98141 Make SDL_VIDEO_OPENGL_EGL optional on Android 2022-03-14 13:38:12 +01:00
Ozkan Sezer
ee6bfcdd66 SDL_blit_N.c: removed duplicated const (fixes bug #5401) 2022-03-13 20:56:42 +03:00
Ozkan Sezer
072db7b005 SDL_windowskeyboard.c (IME_IsTextInputShown): remove unused local vars. 2022-03-12 01:56:40 +03:00
Zach Reedy
d14a126383
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.
2022-03-11 14:45:17 -08:00
Charlie Birks
9de97e19cc emscripten: Don't prevent default on filtered key events 2022-03-11 11:55:41 +00:00
Ozkan Sezer
afb0606f5a minor os/2 clean-ups. 2022-03-10 18:50:10 +03:00
Jo Bates
01d38e7ade Make Win32 fullscreen and borderless windows minimizable 2022-03-09 14:08:12 -08:00
Sylvain
45833a148d
Prevent shadowing static variable '_this' with local paramter '_this' of SDL_CreateWindowTexture 2022-03-09 15:33:45 +01:00