src/video


Log

Author Commit Date CI Message
Frank Praznik 0e446c54 2022-11-04T12:27:36 events: Factor out the xkb keysym to scancode conversion from the X11 driver
Frank Praznik c8551847 2022-11-04T12:41:46 wayland: Handle virtual keyboards that don't fit the X mapping SDL is built around the concept of keyboards having a fixed layout with scancodes that correspond to physical keys no matter what linguistic layout is used. Virtual keyboards don't have this concept and can present an arbitrary layout of keys with arbitrary scancodes and names, which don't fit the SDL model. When one of these keyboards is encountered, it requires special handling: use the keysym of the pressed keys to derive their ANSI keyboard scancode equivalents for control keys and ASCII characters. All other characters are passed through as text events only.
Ryan C. Gordon 44d7b8b9 2022-11-15T13:57:01 egl: Check for a NULL pointer in SDL_EGL_GetProcAddress. This happens on kmsdrm if you try to GetProcAddress before creating a window. Fixes #5399.
Ethan Lee f3cc99fb 2022-11-15T13:56:44 x11: Minor style fixes for recent OSK changes
Sam Lantinga 70656b13 2022-11-15T10:18:41 Don't recreate the window when creating a Metal renderer on an OpenGL window. It turns out that we can safely create a Metal view on an existing window, and that avoids issues with the window being recreated with the wrong orientation in iOS 16. Fixes https://github.com/libsdl-org/SDL/issues/6289
Pierre Wendling 80ff20f6 2022-11-14T23:56:20 N3DS: Set keyboard focus to newly created windows. This fixes polling issues with Joystick subsystem where `SDL_PrivateJoystickShouldIgnoreEvent` would always return true, thus ignoring all inputs.
Sam Lantinga a40b7cde 2022-11-14T13:03:52 Workaround for views being in portrait instead of landscape mode on iOS 16 Fixes https://github.com/libsdl-org/SDL/issues/6289
pionere dad8df3e 2022-11-14T08:20:31 video: check graphics flags the same way in SDL_RecreateWindow as in SDL_CreateWindow - single check to validate the graphics flags - check it before tearing down the window
Frank Praznik eef4d3c8 2022-11-13T16:56:04 wayland: Clamp wl_seat version on older versions of libwayland Clamp the wl_seat max version to 5 if being built against a version of libwayland below 1.21.0, or containers that bundle newer versions of SDL with older versions of libwayland can break if the compositor advertises support for a protocol version above 5.
Sam Lantinga 67498926 2022-11-13T11:09:20 Fixed warning Fixes https://github.com/libsdl-org/SDL/issues/5842
Ethan Lee c4b9f621 2022-11-13T12:45:13 x11: Add support for the Steam Deck on-screen keyboard
pionere 5f2a1231 2022-11-13T08:00:03 video: check graphics flags the same way as the type flags
pionere 22354b41 2022-11-12T08:29:15 video: simplify window-type check in SDL_CreateWindow
Michael Fitzmayer 875e9b35 2022-10-26T15:19:28 N-Gage: additional cleanup
Michael Fitzmayer afbafc2a 2022-10-21T08:11:48 Remove redundant dependency to bitdraw.h, minor cleanup
pionere d09edcbc 2022-11-11T12:10:27 video: sync Metal_CreateView with GL_CreateContext and Vulkan_CreateSurface no need to check if _this->Metal_CreateView, since it is already checked in Re(create)Window
pionere b71d9274 2022-11-11T12:09:15 video: add NOT_AN_OPENGL_WINDOW define (similar to NOT_A_VULKAN_WINDOW)
pionere 36c6ed4b 2022-11-11T08:33:55 video: add SDL_DllNotSupported - add SDL_DllNotSupported and use it to sync the behavior of SDL_GL_LoadLibrary with SDL_Vulkan_LoadLibrary
Sam Lantinga f430ef5d 2022-11-10T17:27:48 Don't change the window position when creating it on iOS, it is already placed on the correct display
pionere 29cafa9c 2022-11-10T08:23:16 add SDL_ContextNotSupported and validate flags in SDL_RecreateWindow similar to SDL_CreateWindow
Ryan C. Gordon 1008cc8e 2022-11-09T12:55:27 video: Add some braces to match SDL coding style.
pionere ac3349fa 2022-11-09T09:11:04 solve FIXMEs in SDL_video.c
Hubert Maier 5dc93451 2022-11-06T20:49:37 JANITORIAL : Correct some more spelling mistakes (#6489)
Sam Lantinga c2675d74 2022-11-06T10:52:20 Revert "cocoa: Discard the IME Candidate Window immediately when Escape is pressed" This reverts commit 0d76e2a8a1a8e6a2801123587c2205a288d49406, as it introduced other issues: https://github.com/libsdl-org/SDL/pull/6486#issuecomment-1304684865
Edward Li 0d76e2a8 2022-11-06T04:59:02 cocoa: Discard the IME Candidate Window immediately when Escape is pressed
David Edmundson 689218eb 2022-11-04T12:07:20 Fix wayland reconnection paths Most of this code is disabled out for now. - For mouse cursors we have a wl_surface for both system and custom cursors which needs recreating. - The other patch is about nullification after deletions
Guldoman 084fa4c3 2022-11-01T10:55:17 cocoa: Reset IME when sending composed text This will send an empty `TEXTEDITING` event that is used to signal the end of the composition.
Guldoman 70a41f9b 2022-11-01T09:59:16 wayland: Read `window` data only if `window` is valid
Frank Praznik 33a43005 2022-10-31T12:23:51 wayland: Don't modify the mouse capture flag in relative mode If relative mouse mode is explicitly enabled, don't modify the capture flag on button events or the window might report having lost mouse focus if a button is pressed while moving the cursor.
Hubert Maier 678ef797 2022-10-30T08:53:34 SDL_KMSDRMOPENGLES.H: Correct spelling mistakes begining -> beginning beggining -> beginning
Ethan Lee 571ff1a3 2022-10-30T00:19:09 wayland: Prepare cursor implementation for reconnect support Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
Ethan Lee 9c8b1fd8 2022-10-29T22:34:05 wayland: Cleanup work to aid reconnect support Co-authored-by: David Edmundson <kde@davidedmundson.co.uk>
Sam Lantinga 4556074e 2022-10-29T09:35:07 Re-set the maximize state if we were maximized while fullscreen
Sam Lantinga ab06a307 2022-10-29T09:21:17 Don't report windows being maximized when fullscreen on X11 This is a functional state for some window managers (tested using stock Ubuntu 22.04.1), and removing that state, e.g. using SDL_RestoreWindow(), results in a window centered and floating, and not visually covering the rest of the desktop.
Ryan C. Gordon b9e1d1b4 2022-10-09T19:49:34 events: Rename SDL_SendKeyboardKeyComplete to SDL_SendKeyboardKeyAndKeycode.+
Ryan C. Gordon 92215481 2022-10-09T19:33:52 emscripten: Make an attempt at correct keyboard scancode/keycodes. This uses a newer browser API to get physical scancodes, but still uses the (deprecated) event field that we were already using for scancodes, but for keycodes instead now, which appears to be more accurate. Since keyboard layout isn't (generally) available to web apps, this adds an internal interface to send key events with both scancode and keycode to SDL's internals, instead of sending just scancodes and expecting SDL to use its own keymap to generate keycodes. Future work in this area would be to use the keyboard layout APIs on browsers that support them, which would allow us to use SDL's usual keymap code and not rely on a deprecated browser API, but until we get there, this patch gives significantly more correct results than we would have before. Fixes #2098.
Sam Lantinga f500c147 2022-10-28T08:39:02 Fixed DirectFB build
Ryan C. Gordon 9e8d2f39 2022-10-27T13:54:53 video: Don't use texture framebuffer on Windows Subsystem for Linux. Reference Issue #6333.
Frank Praznik 4223e6ac 2022-10-26T13:14:50 wayland: Early-out sooner when requesting fullscreen on a popup Exit the fullscreen sequence sooner if it is requested that a popup window be fullscreen. The surface commit formerly in this path is irrelevant and can be removed as previous changes made it so that SetFullscreen() is no longer called from anywhere except Wayland_SetWindowFullscreen().
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.
Frank Praznik 30c2dac7 2022-10-25T20:00:38 wayland: Remove duplicate #include statement
Sam Lantinga b6cf889a 2022-10-25T15:09:43 Use ScreenCount() instead of SDL_GetNumVideoDisplays() The limitation appears to be specific to multi-screen setups
Sam Lantinga e3f5744d 2022-10-25T12:14:00 Don't use XIWarpPointer() on multi-display configurations
Ozkan Sezer 20beed30 2022-10-25T14:56:32 SDL_EGL_GetProcAddress: remove unnecessary underscore-prepended search. Closes https://github.com/libsdl-org/SDL/issues/6236.
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.
Steven Noonan d2300516 2022-09-07T06:49:02 cocoa: set sRGB colorspace on nswindow This makes the colorspace match across different graphics APIs. By default, OpenGL was getting a much more saturated colorspace (maybe Display P3?) and it was looking very different from the rendering done by Metal or MoltenVK.
Steven Noonan 019e9d4c 2022-08-25T23:15:58 SDL_cocoavideo.m: add missing SDL_cocoaopengles.h include
Thomas Cashman 8db3a338 2022-10-23T15:45:20 #6433 Fix WINRT_IsScreenKeyboardShown on Xbox
Sam Lantinga 413500ab 2022-10-22T09:37:34 Replaced mouseWheelGesture with GCMouse support on iOS (thanks @russelltg!) Fixes https://github.com/libsdl-org/SDL/issues/6411
Deve 2ebaafa6 2022-10-18T21:02:49 Use translationInView for mouse wheel event
Ozkan Sezer 0e1d19cf 2022-10-22T18:56:40 fix build errors resulting from -Wmisleading-indentation
Sam Lantinga a905a786 2022-10-22T08:50:18 Clear the previous bitmap when calculating a new window shape Fixes https://github.com/libsdl-org/SDL/issues/6428
Deve 7e108816 2022-10-18T01:07:54 Fixed command modifier on macOS
Deve cdf312c8 2022-10-18T00:48:55 Fixed mouse warp after resizing window on macOS.
David Jacewicz 7c7cd2a6 2022-10-17T14:04:29 Fix issue #6037 (incorrect modifier flags on Wayland)
Frank Praznik ed412c13 2022-10-15T14:05:35 wayland: Cleanup event source comments, headers, and error reporting Replace instances of fprintf(stderr, ...) with SDL_SetError(), replace C++ comments with C style, use a uniform format for multi-line comments, and remove unused headers as poll and select aren't used in this file (the SDL function which calls them is used instead).
Frank Praznik 62047686 2022-10-13T16:24:13 wayland: Don't block on libdecor_dispatch() libdecor_dispatch() needs to be called, as libdecor plugins might do some required internal processing within, however care must be taken to avoid double-blocking in the case of a timeout, which can occur if libdecor_dispatch() and the SDL event processing both work on the main Wayland queue. Additionally, assumptions that libdecor will always dispatch the main queue or not process zero-length queues (can occur if a wait is interrupted by the application queueing an event) should not be made, as this behavior is outside the control of SDL and can change. SDL handles polling for Wayland events and then calls libdecor to do its internal processing and dispatch. If libdecor operates on the main queue, it will dispatch the queued events and the additional wl_display_dispatch_pending() call will be a NOP. If a libdecor plugin uses its own, separate queue, then the wl_display_dispatch_pending() call will ensure that the main queue is always dispatched.
Frank Praznik e89389ba 2022-10-14T20:41:10 wayland: Use MAP_PRIVATE when mapping the keyboard keymap file descriptor Per the Wayland spec, this must be mapped with MAP_PRIVATE in version 7 of the protocol and higher.
Sam Lantinga 91ff8845 2022-10-13T23:56:17 Disable "The key you just pressed is not recognized by SDL." message by default
Sam Lantinga 13919214 2022-10-13T23:23:55 Fixed reported cases of "Keyboard layout unknown" messages In all cases they were using SDL_SCANCODE_TABLE_XFREE86_2 with some keycodes remapped or fewer than expected keycodes. This adds a sanity check that catches all of them and gives them the right scancode table.
Sam Lantinga 2c192385 2022-10-13T22:50:57 Don't remove entries from an existing scancode keymap If we can't find the X11 keysym, it's likely that either the keysym is NoSymbol, in which case we won't hit it anyway, or it's been mapped to a character, in which case the existing mapping is correct for the scancode and the character will be reflected in the keycode mapping.
Sam Lantinga 99f2a503 2022-10-13T22:40:24 X11 scancode mapping cleanup * Consolidated scancode mapping tables into a single location for all backends * Verified that the xfree86_scancode_table2 is largely identical to the Linux scancode table * Updated the Linux scancode table with the latest kernel keycodes (still unmapped) * Route X11 keysym -> scancode mapping through the linux scancode table (which a few hand-written exceptions), which will allow mappings to automatically get picked up as they are added in the Linux scancode table * Disabled verbose reporting of missing keysym mappings, we have enough data for now
Cameron Gutman f5afb7d1 2022-10-13T18:44:15 directfb: Fix return type of DirectFB_RenderPresent()
Desour 6836273d 2022-10-12T00:17:50 Use XIWarpPointer if compiled with xinput2 Co-authored-by: Andrei E <andreien@proton.me>
Ethan Lee be2cb000 2022-10-11T11:16:52 wayland: Check for the input handle before checking the keyboard handle
Frank Praznik 0b88e609 2022-10-11T07:40:35 wayland: Raise wl_seat maximum version to 8 Version 8 is required for supporting axis_value120 high-resolution scroll events.
Pierre Wendling 8117bfe5 2022-10-10T22:29:31 PS2: Ignore warnings from toolchain headers. The `gsInline.h` header creates `Wdeclaration-after-statement` warnings.
Pierre Wendling 5ddac7e0 2022-10-10T22:04:02 PSP: Fix type mismatch warnings.
Pierre Wendling 669532d5 2022-10-10T22:01:49 PSP: Remove dead code. Fixes unused variable warning.
Sam Lantinga 45070835 2022-10-10T09:39:55 Fixed build
Sam Lantinga 680d0f04 2022-10-10T09:26:49 Added support for undefined or centered position for shaped windows Fixes https://github.com/libsdl-org/SDL/issues/6359
Pierre Wendling efc93e68 2022-09-18T15:17:08 N3DS: Don't set `num_display` by hand. Doing so creates 2 empty displays at the beginning of the list.
Pierre Wendling 83ec6062 2022-09-18T13:46:09 N3DS: Move gfxInit and hidInit from main to video.
Pierre Wendling 266014fa 2022-09-18T13:38:26 N3DS: Use SDL_Touch instead of the Joystick touch.
Pierre Wendling f9785702 2022-09-18T13:22:07 N3DS: Deduce screen from window's display. This removes the need for a dedicated window creation flag.
Pierre Wendling 65527537 2021-03-30T04:32:39 N3DS port (squashed) A dedicated renderer using Citro3D would likely allow for better much better graphical performances.
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
Frank Praznik 6391ad97 2022-10-09T11:11:55 wayland: Factor out common libdecor frame commit code The pattern of: libdecor_state_new() libdecor_frame_commit() libdecor_state_free() was used in several places. Factor it out into a common function.
Frank Praznik b0a9396b 2022-10-09T11:06:20 wayland: Remove XDG surface geometry calls These were needed to fix some buggy behavior regarding committing old buffer sizes when entering fullscreen that has since been corrected. Remove them.
Guldoman b91ddbc3 2022-10-09T06:15:18 wayland: null-terminate drop data
Anonymous Maarten eb8eb621 2022-10-06T22:49:17 SDL_x11modes: fix -Wunused-variable
Anonymous Maarten 4298e798 2022-10-06T02:55:30 SDL_offscreenframebuffer.c: fix format '%d' expecting int instead of Uint32 Emitted by Nintendo 3DS's gcc (fix is same as used by ngage)
Frank Praznik 914a65e0 2022-10-06T12:39:36 wayland: Don't unset min/max values when entering fullscreen via a compositor event If the compositor is entering fullscreen and hasn't removed any constraints itself, it's already too late at this point. Remove the unnecessary call. Restoring the limits when exiting fullscreen is still required, though, as they may have been removed when entering fullscreen via an SDL request.
Frank Praznik 69cf5fb0 2022-10-04T13:09:35 wayland: Remove surface type helpers These were remnants of a time before the surface type was explicitly stored, so they can be removed per the TODO note.
Frank Praznik c2b0c41c 2022-10-04T12:59:26 wayland: Set/unset the opaque regions on surfaces when transparency is toggled Caches the SDL_HINT_VIDEO_EGL_ALLOW_TRANSPARENCY hint at init time and registers a callback, which is fired when the hint is changed during runtime and toggles the opaque region for existing surfaces.
Frank Praznik ea595800 2022-10-03T18:31:15 wayland: Set the damage buffer size when supported The preferred method for setting the damage region on compositor protocol versions 4 and above is to use wl_surface.damage_buffer. Use this when available and only fall back to wl_surface.damage on older versions. Bumps the highest supported version of wl_compositor to version 4.
Frank Praznik a8cb7bbe 2022-10-01T11:31:26 wayland: Add dedupe logic to window geometry configuration Adds deduplication logic to ConfigureWindowGeometry() to avoid setting redundant backbuffer, viewport and surface opaque region dimensions. State is now only set when the window and/or backbuffer dimensions change. This repurposes the viewport rect to always hold the actual size of the window, which can differ from the SDL size if things are being scaled. The SDL_Rect was removed in favor of two ints, as the x/y members of the struct were never used, so they just wasted space. Since the internal variables always have the true window size, the width/height getter functions are no longer required and can be removed.
slime d2160c29 2022-10-05T21:42:26 iOS: implement SDL_GetWindowSizeInPixels.
Andrey Filipenkov 92c71ae3 2022-10-05T21:59:08 [iOS] respect initial status bar configuration when displaying the launch storyboard
Andrey Filipenkov 5b131364 2022-08-06T10:48:53 [UIKit] handle app lifecycle events in a custom object instead of AppDelegate removes the need to call SDL counterparts manually when custom AppDelegate is used
Sylvain eac3d6d3 2022-10-04T10:46:42 SDL_video.c: fix variable 'i' may be uninitialized when used here "_this->name = bootstrap[i]->name;"
David Gow ad29875e 2022-04-18T17:03:05 Wayland: Emulate mouse warp using relative mouse mode Several games (including Source and GoldSrc games, and Bioshock Infinite) attempt to "fake" relative mouse mode by repeatedly warping the cursor to the centre of the screen. Since mouse warping is not supported under Wayland, the viewport ends up "stuck" in a rectangular area. Detect this case (mouse warp while the cursor is not visible), and enable relative mouse mode, which tracks the cursor position independently, and so can Warp successfully. This is behind the SDL_HINT_VIDEO_WAYLAND_EMULATE_MOUSE_WARP hint, which is enabled by default, unless the application enables relative mouse mode itself using SDL_SetRelativeMouseMode(SDL_TRUE). Note that there is a behavoural difference, in that relative mouse mode typically doesn't take mouse accelleration into account, but the repeated-warping technique does, so mouse movement can seem very slow with this (unless the game has its own mouse accelleration option, such as in Portal 2).
Sam Lantinga 9e3c4b9f 2022-10-03T17:50:01 Use the correct platform defines
slime f8f562da 2022-10-02T22:55:49 iOS: remove dead pre-iOS 8 codepaths. SDL hasn't supported those older iOS versions for a little while now.
slime bbeacd72 2022-10-02T22:57:03 Fix some credit comments.
Aaron Barany 5e654a4b 2022-10-01T16:10:46 Fixed Mac compile errors when OpenGL is disabled.
Sam Lantinga 28572702 2022-09-30T17:25:57 Properly backspace over text that was entered when autocorrect updates text with the iPhone on-screen keyboard
Frank Praznik e17f0c28 2022-09-27T10:59:28 wayland: Call the Wayland hide/show functions directly when changing decoration modes Calling SDL_HideWindow() to destroy the window is a NOP if the SDL_WINDOW_SHOWN flag was never set. Bypass it and call the Wayland-specific function directly to ensure that the window is always destroyed before switching from server-side to client-side decorations, even if it hasn't been shown yet. Likewise, call Wayland_ShowWindow() directly when the window isn't explicitly hidden to ensure that it is always recreated since the SDL_WINDOW_SHOWN flag won't be cleared, which, when set, renders SDL_ShowWindow() a NOP.
Eric Curtin 57b5c910 2022-09-28T12:38:32 kmsdrm: only negative devindex's are not allowed ad874536 removed an unnecessary limit as we *can* have a devindex greater than 99, this error message does not reflect the support for values greater than 99.