src/video/x11


Log

Author Commit Date CI Message
Pierre Wendling d0bbfdbf 2022-12-01T16:07:03 Clang-Tidy fixes (#6725) (cherry picked from commit 3c501b963dd8f0605a6ce7978882df39ba76f9cd)
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
Sylvain ce5da5d5 2022-11-16T21:47:43 Don't compare pointer against '0', but NULL
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.
Ethan Lee f3cc99fb 2022-11-15T13:56:44 x11: Minor style fixes for recent OSK changes
Ethan Lee c4b9f621 2022-11-13T12:45:13 x11: Add support for the Steam Deck on-screen keyboard
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 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.
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
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
Desour 6836273d 2022-10-12T00:17:50 Use XIWarpPointer if compiled with xinput2 Co-authored-by: Andrei E <andreien@proton.me>
Anonymous Maarten eb8eb621 2022-10-06T22:49:17 SDL_x11modes: fix -Wunused-variable
Cameron Cawley 43fc6d59 2022-09-08T15:53:54 Fix incorrect return value in X11_GetPixelFormatFromVisualInfo
DS ac5b9bc4 2022-09-14T18:28:35 Add support for X11 primary selection (#6132) X11 has a so-called primary selection, which you can use by marking text and middle-clicking elsewhere to copy the marked text. There are 3 new API functions in `SDL_clipboard.h`, which work exactly like their clipboard equivalents. ## Test Instructions * Run the tests (just a copy of the clipboard tests): `$ ./test/testautomation --filter Clipboard` * Build and run this small application: <details> ```C #include <SDL.h> #include <unistd.h> #include <stdbool.h> #include <stdio.h> #include <stdlib.h> #include <time.h> void print_error(const char *where) { const char *errstr = SDL_GetError(); if (errstr == NULL || errstr[0] == '\0') return; fprintf(stderr, "SDL Error after '%s': %s\n", where, errstr); SDL_ClearError(); } int main() { char text_buf[256]; srand(time(NULL)); SDL_Init(SDL_INIT_VIDEO); print_error("SDL_INIT()"); SDL_Window *window = SDL_CreateWindow("Primary Selection Test", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 400, 400, SDL_WINDOW_SHOWN); print_error("SDL_CreateWindow()"); SDL_Renderer *renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED); print_error("SDL_CreateRenderer()"); bool quit = false; unsigned int do_render = 0; while (!quit) { SDL_Event event; while (SDL_PollEvent(&event)) { print_error("SDL_PollEvent()"); switch (event.type) { case SDL_QUIT: { quit = true; break; } case SDL_KEYDOWN: { switch (event.key.keysym.sym) { case SDLK_ESCAPE: case SDLK_q: quit = true; break; case SDLK_c: snprintf(text_buf, sizeof(text_buf), "foo%d", rand()); SDL_SetClipboardText(text_buf); print_error("SDL_SetClipboardText()"); printf("clipboard: set_to=\"%s\"\n", text_buf); break; case SDLK_v: { printf("clipboard: has=%d, ", SDL_HasClipboardText()); print_error("SDL_HasClipboardText()"); char *text = SDL_GetClipboardText(); print_error("SDL_GetClipboardText()"); printf("text=\"%s\"\n", text); SDL_free(text); break; } case SDLK_d: snprintf(text_buf, sizeof(text_buf), "bar%d", rand()); SDL_SetPrimarySelectionText(text_buf); print_error("SDL_SetPrimarySelectionText()"); printf("primselec: set_to=\"%s\"\n", text_buf); break; case SDLK_f: { printf("primselec: has=%d, ", SDL_HasPrimarySelectionText()); print_error("SDL_HasPrimarySelectionText()"); char *text = SDL_GetPrimarySelectionText(); print_error("SDL_GetPrimarySelectionText()"); printf("text=\"%s\"\n", text); SDL_free(text); break; } default: break; } break; } default: { break; }} } // create less noise with WAYLAND_DEBUG=1 if (do_render == 0) { SDL_RenderPresent(renderer); print_error("SDL_RenderPresent()"); } do_render += 1; usleep(12000); } SDL_DestroyRenderer(renderer); SDL_DestroyWindow(window); SDL_Quit(); print_error("quit"); return 0; } ``` </details> * Use c,v,d,f to get and set the clipboard and primary selection. * Mark text and middle-click also in other applications. * For wayland under x: * `$ mutter --wayland --no-x11 --nested` * `$ XDG_SESSION_TYPE=wayland SDL_VIDEODRIVER=wayland ./<path_to_test_appl_binary>`
Brad Smith 371735e9 2022-08-30T15:45:16 Silence unused variable warning SDL_x11dyn.c:123:17: warning: unused variable 'i' [-Wunused-variable] int i; ^
Ryan C. Gordon 4ca7b378 2022-08-21T11:35:14 x11: Specify windowed dimensions when creating fullscreen windows. This lets the window manager adjust the window correctly if it ever leaves fullscreen mode. Fixes #5725.
Sam Lantinga 8acb4e45 2022-08-17T14:25:30 Fixed interactions between mouse capture and grab on X11 Fixes https://github.com/libsdl-org/SDL/issues/6072
Ryan C. Gordon b599205d 2022-08-09T09:50:55 x11: Don't look up xinput2 devices unless we're in relative mode.
Ozkan Sezer 293d29b7 2022-08-04T10:11:02 SDL_x11xinput2.c: fix build for macOS
Ryan C. Gordon 5907db56 2022-08-04T02:11:21 x11: Attempt to deal with XInput2 devices with absolute coordinates. This is untested! Reference Issue #1836.
Shootfast 60d1944e 2022-07-06T20:12:30 SDL_video: Added SDL_GL_FLOATBUFFERS to allow Cocoa GL contexts to use EDR
Sam Lantinga 3a6cb7e7 2022-08-01T10:28:29 Convert XLookupString Latin-1 text to UTF-8 Fixes bug https://github.com/libsdl-org/SDL/issues/4699
Cameron Gutman 8b438f7b 2022-07-31T15:34:03 keyboard: Only send SDL_KEYMAPCHANGED when the keymap actually changes
Sam Lantinga dbf79405 2022-07-27T10:31:24 Enable capturing raw Xinput2 touch events and use to flag global mouse state as dirty - Touch events may be translated to mouse movement events without the normal Xinput2 raw motion events being sent. Not all touch events will necessarily move the mouse but this ensures we update the global mouse state just in case. - Fix up some formatting CR: saml
Ryan C. Gordon 20a76b0e 2022-07-25T23:06:58 video: removed unused devindex argument from bootstrap's create method.
Ryan C. Gordon fdb86b82 2022-07-04T12:48:32 x11: Don't try to use XInput2 multitouch if not supported. Fixes #5889.
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.
Ryan C. Gordon 12b371ee 2022-06-21T14:49:00 x11: Don't send diplay-add events for displays connected at init time. Reference Issue #4977.
Simon McVittie 63b3b9a5 2022-06-13T16:02:40 Fix some typos in diagnostic messages Detected by Debian's packaging QA tool, Lintian. Signed-off-by: Simon McVittie <smcv@collabora.com>
Ryan C. Gordon b75cd2b3 2022-06-10T14:12:03 x11: Force window back to expected size after SDL_SetWindowBordered. This helps if the window manager decided to let it fill the space that an existing border was using before its removal. Fixes #5718.
Ryan C. Gordon ec0204d2 2022-06-06T14:38:26 x11: Don't use GetXftDPI() when XRandR can tell us the DPI per-output. Fixes #5764.
Ryan C. Gordon a236bf4f 2022-06-06T02:13:37 x11: Hook up display hotplug notifications. Obviously this needs XRandR support. Fixes #4977.
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>
Ryan C. Gordon 9edd411a 2022-05-19T17:15:10 x11: send move/resize events when waiting on fullscreen change. Otherwise we ignore the Configure/etc events when they come in because the window is already in an identical state as far as SDL is concerned. Fixes #5593. May also fix: Issue #5572. Issue #5595.
Pierre Wendling 501a4991 2022-05-05T18:44:32 Add clang-format on/off comments where necessary. Comments were added in places where INDENT-ON/OFF comments are. Places like stdlib's asm don't need it as clang-format doesn't try to indent it.
Sam Lantinga c7dff3a2 2022-05-19T00:35:22 Attempt to get the X1 and X2 button state on X11 by using the current event state instead of direct X11 query.
Sam Lantinga 57130b75 2022-05-19T00:31:20 Revert "x11: get x1/x2 button state in GetGlobalMouseState" This reverts commit 3fcc2cb500a752698687ad0c8bb14778e6cb84c3. Button4 and Button5 are for the scrollwheel, not the extended buttons. I don't know of a way to query the state of the extended buttons using X11.
Ryan C. Gordon 2317a96c 2022-05-16T10:50:13 x11: Use XC_top_left_corner/XC_top_right_corner instead of XC_fleur. On Gnome (and hopefully others!), this produces something that actually matches SDL_SYSTEM_CURSOR_SIZENWSE/SDL_SYSTEM_CURSOR_SIZENESW. On other desktop enviroments, it probably fits the spirit better than XC_fleur in any case. Reference Issue #2123.
emily 3fcc2cb5 2022-05-03T11:19:39 x11: get x1/x2 button state in GetGlobalMouseState
Ozkan Sezer 12f15aaa 2022-04-27T10:03:32 fix build
Ryan C. Gordon 05bd225a 2022-04-26T23:14:44 x11: If XRandR isn't available, add a generic display. We can get _some_ of the info we need out of standard Xlib and report a single display (which might actually be multiple physical displays mushed into a single desktop). This is better than nothing, but you should really just build with XRandR support and get a better X server. :)
Ryan C. Gordon ccc70e64 2022-04-26T23:14:21 x11: Fixed some compiler warnings.
Ryan C. Gordon 7d7ec9c9 2022-04-26T16:41:28 x11: Remove XVidMode and Xinerama support. Fixes #1782.
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