src/video/x11


Log

Author Commit Date CI Message
Ryan C. Gordon e73a81b2 2023-08-01T13:55:04 x11: Blocking for window maximization should wait 100 ms, not 1000. Reference Issue #7070. (cherry picked from commit 3030fd815c4d05b5286f7cb9c8a8a2b42cff7bb1)
Ryan C. Gordon 133ad191 2023-08-01T12:10:52 Revert "x11: check if window size/position has changed during SDL_ShowWindow." This reverts commit aa536217b3e1a9ea4a5de9944cadbd79b134a41a. (cherry picked from commit 5c3df60ec913f5b0fd04835af56f3afd42694893)
Sam Lantinga 5733f42c 2023-07-31T14:38:48 Fall back to Xlib if XRandR isn't available This fixes video initialization on headless systems with VNC Fixes https://github.com/libsdl-org/SDL/issues/8054 (cherry picked from commit 71099149b8fc062ea0ece232ccdd9f0ee9b3588b) (cherry picked from commit 8825fbf71391631f1a7ee7ca224a2f4e01cd8814)
Eric Wasylishen 76392f4f 2023-01-11T19:45:01 Handle DPI scaling in SDL_GetWindowSurface Fixes DPI awareness of testdrawchessboard (previously, the surface was being created in points instead of pixels, resulting in the demo app only drawing in a corner of the screen on High-DPI displays) *_CreateWindowFramebuffer()/*_UpdateWindowFramebuffer(): are updated to use SDL_GetWindowSizeInPixels instead of SDL_GetWindowSize() or window->w/window->h. Most of the _CreateWindowFramebuffer backends are untested except for Windows. Fixes #7047 (cherry picked from commit 67c91353e01f6f2c0cc80c17eeddbad6def7cb01)
Ryan C. Gordon aa536217 2023-06-07T15:42:22 x11: check if window size/position has changed during SDL_ShowWindow. Fixes #4216. (cherry picked from commit 49b5cfa6c5cb9bb8cecce508e12fa7f8e0cc302f)
Sam Lantinga 4700fbcb 2023-06-04T05:37:06 Don't bother re-encoding Latin1 characters in the ASCII range (cherry picked from commit 6150b5b3cbde0e592c4ffe822f66aa5f9c90c3d9)
Sam Lantinga bfef7c30 2023-06-04T02:06:52 Only convert the result of XLookupString() if it's not already UTF-8 Fixes https://github.com/libsdl-org/SDL/issues/7766 (cherry picked from commit 491ae20d963cff397b5980b31d142d576e74becb)
Ryan C. Gordon 379a6f4d 2023-05-30T17:04:31 x11: Attempt to wait for SDL_MaximizeWindow to complete before returning. Fixes #7070.
Anonymous Maarten c6897636 2023-02-18T04:48:24 Fix -Wunused-function warning when configuring with -DSDL_X11_XINPUT2=OFF
Ryan C. Gordon a535cc62 2023-05-25T10:04:44 video: Only specify some GL context attributes if not the explicit default. Just in case it upsets some OpenGL drivers unnecessarily. Fixes #7730. (cherry picked from commit d4bc393efebdd45a95430397df106b69b1c26df3)
Sam Lantinga 3f1fd5ab 2023-05-23T10:59:03 Updated source to match SDL function prototype style
Frank Praznik 55f74c32 2023-03-29T15:16:59 x11: Don't allow the changing of certain scancodes The X11 driver uses scancodes derived from keysyms to map the scancodes for extended keys to the physical keyboard, however, this can be incorrect when using certain XKB options (e.g. caps:swapescape), which changes the keysyms emitted by certain keys, but does not imply that their scancodes or positions should be altered. Mark selected scancodes as being non-remappable so that their scancodes aren't changed by toggling XKB mapping options.
Sylvain 2dddaa7d 2023-03-25T10:24:38 backport x11/sdl2 fixes 4b1378f X11: fix size/position (test video_setWindowCenteredOnDisplay) this fix x11 backend to correctly pass video_setWindowCenteredOnDisplay() get border values early (eg status bar) wait for size/position change to get valid values d4d26e0 testautomation_video: if SDL_SetWindowSize/Position isn't honored, we should check there is an event x11: send the events if various occasions
Sam Lantinga 0d763800 2023-03-09T15:10:00 Code style: changed "sizeof foo" to "sizeof(foo)" (thanks @sezero!) (cherry picked from commit c6443d86c92e962683a1efe5f123a144988875b5)
Torge Matthies 711a458b 2023-02-16T19:11:43 x11: Fix duplicate Xinput2 event reception Passing True for owner_events in the XGrabPointer call makes all XI_RawMotion events appear in the queue twice, with the only difference between them being the value of XGenericEventCookie::cookie. These have always been filtered out by a check in the XI_RawMotion handler, however with a mouse that polls at more than 1 kHz frequency, there also exist legitimate events that appear indistinguishable from these duplicated events. These must not be filtered out, otherwise the pointer may move at an inconsistent speed, appearing like a bad pointer acceleration implementation. Change owner_events to False in the XGrabPointer and remove the duplicate event detection code to fix this. Signed-off-by: Torge Matthies <openglfreak@googlemail.com> (cherry picked from commit f18b5656f6f859e4d4e096d290afd9fae884a5b8)
Sam Lantinga 7b060072 2023-02-19T09:57:35 Fixed typo (thanks @Iniquitatis!) (cherry picked from commit ced02319a6bd001c1c2ce85a48887efe3a7b79d8)
Lauri Kasanen 7d55ccb8 2023-02-19T16:04:47 Fix GetGlobalMouseState when xi2 is not available at runtime (cherry picked from commit 0123d6311d5c0059d617324426ef7eef8d577d9b)
Le Philousophe 74e8a645 2023-02-18T18:21:09 Fix window size in X11 when window manager refuses to resize (cherry picked from commit a67ae8eed57f4545c739e6eb3a4b8c1169d3afbc)
Ozkan Sezer da6bce4f 2023-02-11T23:51:28 SDL_x11dyn.h: include XInput2.h also for Xfixes Fixes https://github.com/libsdl-org/SDL/issues/7343
Sylvain 17515f4a 2023-02-04T15:51:37 Backport simplify flags PR #7220
Sam Lantinga 0479df53 2023-01-09T09:48:21 Updated copyright for 2023
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 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.
Frank Praznik 0e446c54 2022-11-04T12:27:36 events: Factor out the xkb keysym to scancode conversion from the X11 driver
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 😂