src/video/x11


Log

Author Commit Date CI Message
Sam Lantinga 01ef98a5 2022-04-26T10:19:03 Don't force keyboard auto-repeat on, if the user has disabled it for some reason Fixes https://github.com/libsdl-org/SDL/issues/2400
Ryan C. Gordon 53dea983 2022-04-25T13:51:15 x11: revert checks for _NET_WM_STATE_FULLSCREEN changes. This reverts commit 85977354fbce9ecb2add660a88e6bec3532c3e26. This reverts commit 0249df9d960f9bc28b476e1171c5501fc37cca12. Fixes #5572. Reopens #5390.
Sam Lantinga 02225aa7 2022-04-18T22:57:03 Fixed build
Ryan C. Gordon 49a2e4b0 2022-04-19T00:36:53 x11: Revert "Fix keymap updating for X11 backend" This reverts commit de6d290266d1def0eef9df81bf9be41c12a98c61. This patch had multiple issues, discussed in #5520.
Ryan C. Gordon 67e0f546 2022-04-15T18:24:57 x11: Update the display when the WM changes a window's fullscreen state. Fixes #5390.
Sam Lantinga 49b9e347 2022-04-07T08:24:03 Only update modifier state for keys that are pressed in another application Fixes https://github.com/libsdl-org/SDL/issues/4432
Ryan C. Gordon 85977354 2022-04-07T09:14:33 x11: Treat WM setting the window "fullscreen" like FULLSCREEN_DESKTOP. Fixes #5390.
Ryan C. Gordon 0249df9d 2022-04-05T23:04:19 x11: Try to keep SDL_WINDOW_FULLSCREEN* in sync with window manager. So if Gnome/KDE/etc have a keyboard shortcut or titlebar decoration to make any window go fullscreen (with the _NET_WM_FULLSCREEN flag on the _NET_WM_STATE property), we update the SDL window flag. Fixes #5390.
Weng Xuetian 138d96c8 2022-04-05T19:30:25 Send key release event to input method. (#5281) Co-authored-by: Ethan Lee <flibitijibibo@gmail.com>
Ryan C. Gordon 8bae343f 2022-04-05T22:19:25 x11: when waiting on fullscreen changes, not window position _and_ size. This makes sure the window doesn't have outdated values if you try to access them (or call something that does, like SDL_SetWindowMinimumSize). Fixes #5233.
Ryan C. Gordon a5672b85 2022-04-05T11:10:41 x11: Wait a bit to see if window pos changes when changing fullscreen. Helps prevent window from moving to 0,0 when leaving fullscreen. Fixes #4749.
Cameron Gutman 45372b1c 2022-04-04T21:36:25 x11: Don't unload libGL.so to prevent a crash in XCloseDisplay() libGL.so may register callbacks that can be invoked upon XCloseDisplay(). If XCloseDisplay() is called after libGL.so is unloaded, the callback pointer will point at freed memory and invoking it will crash. The texture framebuffer check optimized out in f37e4a9 was causing libGL.so to never be unloaded as a side-effect. Skipping it exposed this bug by allowing libGL.so to actually unload.
Ryan C. Gordon 1c7bf478 2022-03-31T10:09:02 x11: Ignore BadValue for extremely small XRRSetScreenSize resolutions. Reference Issue #4840.
Ryan C. Gordon 7e15ad2f 2022-03-30T14:15:52 x11: Catch X11 errors in X11_SetWindowPosition and X11_SetWindowSize. The functions can go south if other operations are in progress, like X11_SetWindowBordered, which might be doing something traumatic behind the scenes of the window manager. We can't make these tasks totally synchronous, which would fix the problem, because not only can the window manager block however long it wants, it might also decide to deny our requests without any notification, so we'd be waiting forever for a window change that isn't coming. :( Fixes #5274.
Ryan C. Gordon d597a9b4 2022-03-24T14:25:00 x11: Minor cleanups and corrections in X11_ShowMessageBox. Reference issue #3254.
Sylvain 6c56193a 2022-03-24T18:09:45 Fixed bug #1650: X11 doesn't set KMOD_NUM and KMOD_CAPS to system state
Sylvain 85e65000 2022-02-11T11:08:08 X11 Segmentation fault with multiple windows and renderers (see #5256)
Sylvain 8c660ccb 2022-01-25T17:14:01 Fixed bug #5256: X11 Segmentation fault with multiple windows and renderers First window is created and it triggers and 'EnterNotify' event which calls SDL_SetMouseFocus() and X11_ShowCursor() while the second windows hasn't finished to be created (eg window->driverdata isn't set) Just check for a valid 'driverdata'
Ryan C. Gordon 42302d0a 2022-01-11T21:17:21 x11: Let apps specify a custom _NET_WM_WINDOW_TYPE. Fixes #5185.
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
rohlem 0403fa8a 2022-01-02T02:36:23 X11_WaitEventTimeout: remove unreachable return If that condition was reachable, the return value should be negative to indicate that waiting for the timeout failed. Otherwise, SDL_WaitEventTimeout would incorrectly return early.
Sylvain 6101499c 2021-12-16T09:07:31 BigEndian: fix code that generates illegal instruction with gcc-4.9.2 on powerpc Program received signal SIGILL, Illegal instruction. X11_InitKeyboard (_this=0x1001f8f0) at /home/sdl/SDL_git/src/video/x11/SDL_x11keyboard.c:273 273 XKeyboardState values = { .global_auto_repeat = AutoRepeatModeOff };
David Gow 9da93d07 2021-12-08T12:38:16 video: x11: Set XImage's byte_order field (fix #5081) If the X server's byte order is different from the client, things might display in the wrong colour. Apparently we can just set the byte_order field to the client's byte order, and the X server will adjust everything automatically: https://xorg.freedesktop.narkive.com/GbSD1aPq/ximage-s-byte-order-field
Ozkan Sezer 03019c91 2021-12-06T20:37:52 autotools, cmake: tighten Xfixes check && explicitly test BarrierEventID Apparently the older versions of libXi doesn't have it. Fixes the build break issue reported at: https://github.com/libsdl-org/SDL/commit/4b42c05ba1eaaaa9a4ef803acea8f13402271039#commitcomment-61427659
David Gow f6fdbc1e 2021-11-29T21:16:15 video: x11: Fix an invalid SDL_LogError() call This fixes a compile warning — and possible invalid memory read — introduced in 9c03d255 ("Add back X11 legacy WM_NAME encodings"), which was part of PR #5029, fixing Bug #4924. The issue is with one of the added warnings in X11_GetWindowTitle(). Basically, the "title" variable passed to SDL_LogError() hasn't been initialised yet: we could pass propdata in directly, but it's better to move the SDL_LogError() call until after title is set, IMHO. This fixes the following warning from gcc (SUSE Linux) 11.2.1: In file included from /home/david/Development/SDL/src/video/x11/../../SDL_internal.h:45, from /home/david/Development/SDL/src/video/x11/SDL_x11window.c:21: /home/david/Development/SDL/src/video/x11/SDL_x11window.c: In function 'X11_GetWindowTitle': /home/david/Development/SDL/src/video/x11/../../dynapi/SDL_dynapi_overrides.h:33:22: warning: '%s' directive argument is null [-Wformat-overflow=] 33 | #define SDL_LogDebug SDL_LogDebug_REAL /home/david/Development/SDL/src/video/x11/SDL_x11window.c:720:13: note: in expansion of macro 'SDL_LogDebug' 720 | SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "Failed to convert WM_NAME title expecting UTF8! Title: %s", title); | ^~~~~~~~~~~~
Fredrick Brennan b5d47aa2 2021-11-28T23:15:31 Fix comment style for old compilers (`//`⇒`/**/`)
Fredrick Brennan 367684b0 2021-11-28T22:56:24 Add patches suggested by @slouken in round 1 review
Fredrick Brennan 9c03d255 2021-11-28T16:18:39 Add back X11 legacy WM_NAME encodings Closes #4924. Based on patches of the past, such as this work by James Cloos in July 2010: https://github.com/exg/rxvt-unicode/commit/d7d98751b7385416ad1694b5f1fde6c312ba20d5, as well as code comments in the Perl module X11::Protocol::WM (https://metacpan.org/pod/X11::Protocol::WM) and even the code to Xlib itself, which taught me that we should never have been using `XStoreName`, all it does is call `XChangeProperty`, hardcoded to `XA_STRING`! What can I say, when the task is old school, the sources are too 😂
Sylvain fae70349 2021-11-23T10:33:12 Fix warnings: static, include, un-initialized vairables
Sylvain 8dd6edec 2021-11-23T09:30:42 Fixed bug #3232 - Integer overflow generates Illegal instruction under sanitizers + see bug #4995
Sylvain 9fcc630f 2021-11-22T16:37:34 X11: use SDL_malloc
Sylvain b4aeaa30 2021-11-22T11:20:52 Use SDL_calloc / SDL_free
Sylvain d31251b0 2021-11-21T22:30:48 use SDL's functions version inplace of libc version
Ozkan Sezer 7dfd22ac 2021-11-14T02:32:00 fix XGetDefault signature - its first and second params are _Xconst
Cameron Gutman eb3f1462 2021-11-12T18:26:15 x11: Fix memory leak in X11_CreatePixmapCursor()
Sam Lantinga c2dd50a9 2021-11-12T08:28:02 Fixed whitespace
Sam Lantinga eda4c407 2021-11-10T12:46:54 Make sure the X event is an Xkb event before checking the Xkb event type
Sam Lantinga 18e69827 2021-11-08T22:29:02 Fixed Linux build
Sam Lantinga fd79607e 2021-11-08T21:34:48 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)
Cameron Gutman 9c95c249 2021-11-08T20:01:56 x11: Use XCheckIfEvent() instead of XNextEvent() for thread-safety A racing reader could read from our fd between SDL_IOReady()/X11_Pending() and our call to XNextEvent() which will cause XNextEvent() to block for more data. Avoid this by using XCheckIfEvent() which will never block. This also fixes a bug where we could poll() for data, even when events were already read and pending in the queue. Unlike the Wayland implementation, this isn't totally thread-safe because nothing prevents a racing reader from reading events into the queue between our XCheckIfEvent() and SDL_IOReady() calls, but I think this is the best we can do with Xlib.
Sam Lantinga 7d21322d 2021-11-08T16:29:19 Implemented SDL_SetWindowMouseRect() on Windows
Ethan Lee 4b42c05b 2021-11-08T13:52:48 video: Add SDL_SetWindowMouseRect. This API and implementation comes from the Unreal Engine branch of SDL, which originally called this "SDL_ConfineCursor". Some minor cleanup and changes for consistency with the rest of SDL_video, but there are two major changes: 1. The coordinate system has been changed so that `rect` is _window_ relative and not _screen_ relative, making it easier to implement without having global access to the display. 2. The UE version unset all rects when passing `NULL` as a parameter for `window`, this has been removed as it was an unused feature anyhow. Currently this is only implemented for X, but can be supported on Wayland and Windows at minimum too.
Sam Lantinga 6c56e275 2021-11-08T07:05:17 Set both _NET_WM_NAME and WM_NAME so SDL windows can be shared in the browser. Fixes https://github.com/libsdl-org/SDL/issues/4924
Cameron Gutman a5598649 2021-10-30T19:30:34 x11/wayland: Fix signal handling while blocking in WaitEventTimeout() Add a new flag to avoid suppressing EINTR in SDL_IOReady(). Pass the flag in WaitEventTimeout() to ensure that a SIGINT will wake up SDL_WaitEvent() without another event coming in.
Cameron Gutman c97c4687 2021-10-30T15:56:54 core: Convert SDL_IOReady()'s 2nd parameter to flags
Cameron Gutman f499168c 2021-10-24T15:54:57 x11: Use SDL_IOReady() instead of calling select() directly SDL_IOReady() properly handles EINTR and can use poll() if available.
Cacodemon345 19dee1cd 2021-10-22T06:37:20 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
Sylvain 649a33ae 2021-10-18T23:00:43 X11: remove redundant 'wakeup_lock' mutex creation
Ethan Lee 7ed415d2 2021-09-23T14:07:38 wayland: Reuse KeySymToUcs4 to replicate X11 keymap behavior
Ryan C. Gordon 478f9eed 2021-09-20T10:20:04 x11: Don't include X11/extensions/extutil.h We don't use it, it was a leftover from 1.2, I think, and it doesn't exist on Solaris, so this should hopefully fix the build there. This also means we don't need the configure/cmake checks for SDL_VIDEO_DRIVER_X11_CONST_PARAM_XEXTADDDISPLAY, so that was removed also. Fixes #1666.
Rokas Kupstys 515b7e93 2021-08-27T17:02:07 Fix horizontal wheel scroll direction of X11.
Ryan C. Gordon d5fe9c30 2021-08-24T14:18:47 x11: Log a warning if we decide to use XVidMode. Reference issue #1782.
Simon McVittie 25cd749a 2021-08-12T15:12:04 x11: Don't change mode if we are already in the correct mode If we are already in the desired mode, changing it is a no-op at best, and harmful at worst: on Xwayland, it sometimes happens that we disable the crtc and cannot re-enable it. Resolves: https://github.com/libsdl-org/SDL/issues/4630 Signed-off-by: Simon McVittie <smcv@collabora.com>
Sam Lantinga cb1e20b0 2021-08-10T17:50:17 Added KMOD_SCROLL to track the scroll lock state Fixes https://github.com/libsdl-org/SDL/issues/4566
Ozkan Sezer 77c8d111 2021-08-10T20:55:50 configuration updates for dlopen: - cmake, configure (CheckDLOPEN): --enable-sdl-dlopen is now history.. detach the dl api discovery from SDL_LOADSO_DLOPEN functionality. define HAVE_DLOPEN. also define DYNAPI_NEEDS_DLOPEN (CheckDLOPEN is called only for relevant platforms.) - update SDL_config.in and SDL_config.cmake accordingly. - SDL_dynapi.h: set SDL_DYNAMIC_API to 0 if DYNAPI_NEEDS_DLOPEN is defined, but HAVE_DLOPEN is not. - pthread/SDL_systhread.c: conditionalize dl api use to HAVE_DLOPEN - SDL_x11opengl.c, SDL_DirectFB_opengl.c, SDL_naclopengles.c: rely on HAVE_DLOPEN, not SDL_LOADSO_DLOPEN. - SDL_config_android.h, SDL_config_iphoneos.h, SDL_config_macosx.h, SDL_config_pandora.h, and SDL_config_wiz.h: define HAVE_DLOPEN. Closes: https://github.com/libsdl-org/SDL/pull/4351
Cameron Gutman 6ae227d0 2021-08-08T23:27:08 x11/wayland: fix screensaver suspension via D-Bus b08b1bde introduced a subtle bug. Despite not using D-Bus types directly, the code used the SDL_USE_LIBDBUS definition set by SDL_dbus.h to conditionally compile calls SDL_DBus_ScreensaverTickle() and SDL_DBus_ScreensaverInhibit(). As a result, it still compiled without SDL_dbus.h included, but screensaver suspension silently failed to work. The D-Bus stuff could probably use some tweaks to be harder to accidentally break, but for now just restore the header includes.
Cameron Gutman b08b1bde 2021-08-03T22:50:58 linux: remove d-bus lazy init dead code Lazy init in X11/Wayland is dead code since dbdbae4
Sam Lantinga b033cd0d 2021-07-31T16:01:48 Fixed XSync sequence to match other cases where we set the X11 error handler
Ryan C. Gordon 4c7825f6 2021-07-31T18:27:14 x11: XSync while trying to catch XRRSetScreenSize error. Reference issue #4561
Ryan C. Gordon d0effadf 2021-07-31T15:56:30 x11: Don't let XRRSetScreenSize fire a BadMatch error. This is a workaround and not a proper fix, but this is possibly complicated, and possibly a corner case, so this will do for 2.0.16, if not the foreseeable future. Reference issue #4561
Jessica Clarke 8f38ba4d 2021-07-29T18:02:47 Fix casts that should be using uintptr_t This is needed to support CHERI, and thus Arm's experimental Morello prototype, where pointers are implemented using unforgeable capabilities that include bounds and permissions metadata to provide fine-grained spatial and referential memory safety, as well as revocation by sweeping memory to provide heap temporal memory safety. On most systems (anything with a flat memory hierarchy rather than using segment-based addressing), size_t and uintptr_t are the same type. However, on CHERI, size_t is just an integer offset, whereas uintptr_t is still a capability as described above. Casting a pointer to size_t will strip the metadata and validity tag, and casting from size_t to a pointer will result in a null-derived capability whose validity tag is not set, and thus cannot be dereferenced without faulting. The audio and cursor casts were harmless as they intend to stuff an integer into a pointer, but using uintptr_t is the idiomatic way to do that and silences our compiler warnings (which our build tool makes fatal by default as they often indicate real problems). The iconv and egl casts were true positives as SDL_iconv_t and iconv_t are pointer types, as is NativeDisplayType on most OSes, so this would have trapped at run time when using the round-tripped pointers. The gles2 casts were also harmless; the OpenGL API defines this argument to be a pointer type (and uses the argument name "pointer"), but it in fact represents an integer offset, so like audio and cursor the additional idiomatic cast is needed to silence the warning.
Aaron Plattner 1e07dba0 2021-06-09T15:26:38 x11: Use glXChooseFBConfig when available in X11_GL_GetVisual When choosing an X11 Visual for a window based on its GLX capabilities, first try glXChooseFBConfig (if available) before falling back to glXChooseVisual. This normally does not make a difference because most GLX drivers create a Visual for every GLXFBConfig, exposing all of the same capabilities. For GLX render offload configurations (also know as "PRIME") where one GPU is providing GLX rendering support for windows on an X screen running on a different GPU, the GPU doing the offloading needs to use the Visuals that were created by the host GPU's driver rather than being able to add its own. This means that there may be fewer Visuals available for all of the GLXFBConfigs the guest driver wants to expose. In order to handle that situation, the NVIDIA GLX driver creates many GLXFBConfigs that map to the same Visual when running in a render offload configuration. This can result in a glXChooseVisual request failing to find a supported Visual when there is a GLXFBConfig for that configuration that would have worked. For example, when the game "Unnamed SDVX Clone" [1] tries to create a configuration with multisample, glXChooseVisual fails because the Visual assigned to the multisample GLXFBConfigs is shared with the GLXFBConfigs without multisample. Avoid this problem by using glXChooseFBConfig, when available, to find a GLXFBConfig with the requested capabilities and then using glXGetVisualFromFBConfig to find the corresponding X11 Visual. This allows the game to run, although it doesn't make me any better at actually playing it... Signed-off-by: Aaron Plattner <aplattner@nvidia.com> Fixes: https://forums.developer.nvidia.com/t/prime-run-cannot-create-window-x-glxcreatecontext/180214 [1] https://github.com/Drewol/unnamed-sdvx-clone
Adam a2031948 2021-07-28T14:06:51 Added in a MIME-type to the X11 clipboard. (#4385)
Mathieu Eyraud 8e604a5f 2021-07-25T18:44:33 Fix error handling in X11_SetWindowTitle X11_XChangeProperty return 1 on success.
Sam Lantinga ff1b5e1b 2021-07-24T15:10:57 Implemented the window flash operations for X11
Sam Lantinga f1633127 2021-07-24T13:41:55 Added a window flash operation to be explicit about window flash behavior
Sam Lantinga e1c3a250 2021-07-24T12:11:27 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
Austin Shafer 16e3bfe8 2021-06-28T11:29:16 SetDisplayMode: Call XRRSetScreenSize before setting CRTC config X11_SetDisplayMode currently calls X11_XRRSetCrtcConfig alone. This results in the monitor's viewport getting changed, but the underlying screen dimensions stay the same. The spec indicates that RRSetCrtcConfig only changes the crtc mode and has no effect on the screen dimensions, only mentioning that the new crtc must fit entirely within the screen size. For the size to change, RRSetScreenSize also needs to be called. This affects Metro Exodus on Linux, when changing the resolution in the in-game settings Metro gets stuck in a loop waiting for the size of its vulkan surface to change. Because XRRSetScreenSize is not called the screen size is never changed, the vulkan surface dimensions do not change, and Metro hangs forever watching for a surface size update that will never come. This change disables the CRTC, calls XRRSetScreenSize, and then updates the CRTC configuration. This fixes changing the resolution from the Metro settings. Tested with: Metro Exodus, Portal 2
Ryan C. Gordon e65a6583 2021-06-09T22:10:20 x11: Add a hint to force override-redirect. Fixes #3776.
Jupeyy 64724db0 2021-06-04T19:55:30 Implement bare minimum for SDL_FlashWindow
Francesco Abbate 0dd7024d 2021-03-12T21:58:20 Modifies WaitEvent and WaitEventTimeout to actually wait instead of polling When possible use native os functions to make a blocking call waiting for an incoming event. Previous behavior was to continuously poll the event queue with a small delay between each poll. The blocking call uses a new optional video driver event, WaitEventTimeout, if available. It is called only if an window already shown is available. If present the window is designated using the variable wakeup_window to receive a wakeup event if needed. The WaitEventTimeout function accept a timeout parameter. If positive the call will wait for an event or return if the timeout expired without any event. If the timeout is zero it will implement a polling behavior. If the timeout is negative the function will block indefinetely waiting for an event. To let the main thread sees events sent form a different thread a "wake-up" signal is sent to the main thread if the main thread is in a blocking state. The wake-up event is sent to the designated wakeup_window if present. The wake-up event is sent only if the PushEvent call is coming from a different thread. Before sending the wake-up event the ID of the thread making the blocking call is saved using the variable blocking_thread_id and it is compared to the current thread's id to decide if the wake-up event should be sent. Two new optional video device methods are introduced: WaitEventTimeout SendWakeupEvent in addition the mutex wakeup_lock which is defined and initialized but only for the drivers supporting the methods above. If the methods are not present the system behaves as previously performing a periodic polling of the events queue. The blocking call is disabled if a joystick or sensor is detected and falls back to previous behavior.
Kyle Schaefer 4522cb1d 2021-05-25T03:17:03 Changing variable from float to int, this way we can check it's value without having to do an unnecessary conversion. Then do explicit conversions later on if we need.
Kyle Schaefer c289bad9 2021-03-22T11:22:31 In x11, GetDisplayDPI can give incorrect or unusable DPI information. Using XGetDefaults to get the Xft DPI if it's available and returning that. This could allow you to figure out DPI scale.
Sylvain 62a562de 2021-05-12T23:37:18 X11: use x11sym loaded functions (see bug #3978)
Sylvain 531d83bf 2021-05-12T23:13:48 X11: allow using touchscreen, while pointer is grabbed (see bug #3978)
Fredrick Brennan c5dd9964 2021-04-07T12:14:16 Copied X11 error handler code from SDL_x11opengl.c Avoids needing to malloc to hold the error string.
Fredrick Brennan b3b4677e 2021-04-07T11:17:52 (X11) Set _NET_WM_NAME properly, fixes Unicode window titles Removes deprecated code meant to support extremely ancient, pre-UTF-8 versions of Xorg. Uses new xlib API's for doing this same thing. Closes #4288.
Ryan C. Gordon 1f482174 2021-04-25T12:44:35 x11: Mark backing_store as NotUseful when creating windows. This can give some performance boost, and save some resources, as there's no reason to keep a copy of an SDL window's contents on the server: most SDL apps are redrawing completely every frame, and the API allows for expose events to tell an app a redraw is needed anyhow. (And compositors are free to ignore this setting if it makes sense to do so, according to the Xlib docs.) Reference Issue #3776.
Ryan C. Gordon 9c063468 2021-04-24T19:47:10 x11: call XSync before XSetInputFocus during SDL_ShowWindow. This only happens when using a non-NET_WM window manager, as we might try to set the focus before the window is mapped. Fixes #3949.
Cacodemon345 0838f53d 2021-04-21T11:41:08 Implement SDL_SetWindowAlwaysOnTop for X11
ReNoM de6d2902 2021-04-19T21:48:11 Fix keymap updating for X11 backend
Ryan C. Gordon dbdbae44 2021-04-02T14:35:11 linux: (de)initialize d-bus at init and quit. Previously we had different subsystems quitting it, in conflict, and risked multiple threads racing to init it at the same time. Fixes #3643.
Cameron Gutman 808249a5 2021-01-27T19:40:55 X11: Ungrab the keyboard when the mouse leaves the window GNOME Mutter requires keyboard grab for certain important functionality like window resizing, interaction with the application context menu, and opening the Activites view. To allow Mutter to grab the keyboard as needed, we'll ungrab when the mouse leaves our window. To be safe, we'll do this for all WMs since forks of Mutter and Matacity (and possibly others) may have the same behavior, and we don't want to have to keep track of those.
Cameron Gutman 6b057c67 2021-01-26T19:16:17 Expose separate keyboard and mouse grab support This adds SDL_SetWindowKeyboardGrab(), SDL_GetWindowKeyboardGrab(), SDL_SetWindowMouseGrab(), SDL_GetWindowMouseGrab(), and new SDL_WINDOW_KEYBOARD_GRABBED flag. It also updates the test harness to exercise this functionality and makes a minor fix to X11 that I missed in https://hg.libsdl.org/SDL/rev/02a2d609369b To fit in with this new support, SDL_WINDOW_INPUT_CAPTURE has been renamed to SDL_WINDOW_MOUSE_CAPTURE with the old name remaining as an alias for backwards compatibility with older code.
Cameron Gutman a0d3c6c6 2021-01-25T21:42:14 Rename SetWindowGrab() to SetWindowMouseGrab()
Cameron Gutman e1f73e64 2021-01-23T16:22:44 Refactor keyboard grab to be managed by the video core This gives us flexibility to add others hints to control keyboard grab behavior without having to touch all of the backends. It also allows us to possibly expose keyboard grab separately from mouse grab for applications that want to manage those independently.
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Sam Lantinga 93ccdee8 2020-12-23T13:47:49 Fixed bug 5404 - stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf Cameron Cawley stdlib: Added SDL_round, SDL_roundf, SDL_lround and SDL_lroundf The default implementation is based on the one used in the Windows RT video driver.
Ozkan Sezer 5c212cb0 2020-12-10T12:24:24 remove a few stale NULL message/title checks after commit e2b729b1756a top-level guarantees non-NULL message / title passed in messageboxdata
Ozkan Sezer f1cab8ae 2020-12-10T11:20:56 fix bug #5253: handle NULL title or message fields in SDL_MessageBoxData - SDL_video.c (SDL_ShowMessageBox): replace messageboxdata, set title or message field to "" if either of them is NULL. - SDL_video.c (SDL_ShowSimpleMessageBox): set title or message to "" if either of them is NULL for EMSCRIPTEN builds. - SDL_bmessagebox.cc: add empty string check along with NULL check for title and message fields. - SDL_windowsmessagebox.c (AddDialogString): remove NULL string check - SDL_windowsmessagebox.c (AddDialogControl): add empty string check along with the NULL check. - SDL_x11messagebox.c: revert commit 677c4cd68069 - SDL_os2messagebox.c: revert commit 2c2a489d76e7 - test/testmessage.c: Add NULL title and NULL message tests.
Sam Lantinga cb361896 2020-12-09T07:16:22 Fixed bug 5235 - All internal sources should include SDL_assert.h Ryan C. Gordon We should really stick this in SDL_internal.h or something so it's always available.
Ryan C. Gordon 0ff5d55a 2020-11-23T21:07:28 x11: Don't try to grab the pointer on an unmapped window (thanks, Lee!) Fixes Bugzilla #5352.
Ryan C. Gordon 335cfa10 2020-11-18T11:24:08 x11: Don't crash if a messagebox has a NULL title string. Fixes Bugzilla #5253.
Sam Lantinga 1ef45c18 2020-11-08T23:40:17 Fixed bug 5339 - Minor memory leak in SDL_x11events.c wcodelyokoyt The atom name that X11_GetAtomName() returns never gets freed, which result in a minor memory leak (14 bytes?) every time the user drops a file on a window. You can see the line in question here: https://github.com/spurious/SDL-mirror/blob/6b6170caf69b4189c9a9d14fca96e97f09bbcc41/src/video/x11/SDL_x11events.c#L1350 Fix: call XFree on name after the while loop.
Alberts Muktup?vels 73010da4 2020-10-19T17:26:33 x11events: ignore UnmapNotify events from XReparentWindow UnmapNotify event does not mean that window has been iconified. It just reports that window changed state from mapped to unmapped. XReparentWindow can unmap and remap window if it was mapped. This causes unnecessary events - HIDDEN, MINIMIZED, RESTORED and SHOW. These events are problematic with Metacity 3.36+ which started to remove window decorations from fullscreen windows. - SDL makes decorated window fullscreen - Metacity removes decorations - SDL gets UnmapNotify and exits from fullscreen - Metacity re-adds decorations As SDL will also get MapNotify event it will try to restore window state causing above steps to repeat. https://bugzilla.libsdl.org/show_bug.cgi?id=5314
Sam Lantinga 76980e30 2020-10-08T16:42:20 Added events for dynamically connecting and disconnecting displays, with an iOS implementation
Sam Lantinga 8709f67e 2020-09-08T08:42:30 Fixed bug 5215 - Fixing filenames passed to dlopen for OpenBSD Brad Smith Attached is a patch to use the proper filenames when trying to dlopen the respective shared libraries on OpenBSD.
Cameron Gutman 9a769da0 2020-09-07T20:10:50 X11: Remove our X11 error callback in X11_DeleteDevice() If we don't remove it, we will infinitely recurse if X11_CreateDevice() is called again and orig_x11_errhandler becomes X11_SafetyNetErrHandler().
M Stoeckl 8669a87f 2020-07-14T21:13:27 Reuse X11 connection from availability check Instead of creating an X11 connection to test that X11 is available, closing the connection, and then reconnecting for real, use the same connection to handle both cases. The X11 connection retry delay mechanism in the case where X11 is dynamically loaded has been removed. It was only necessary to avoid authetnication token reuse from the XOpenDisplay call that used to exist in X11_Available. Now that this call is only made once, it is no longer needed. Also drop unused and inapplicable code from a comment. ***
M Stoeckl 052a1373 2020-07-12T19:11:15 Merge VideoBootStrap::available into VideoBootStrap::create The two are only ever called together, and combining them makes it possible to eliminate redundant symbol loading and redundant attempts to connect to a display server.