src/video


Log

Author Commit Date CI Message
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 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.
Pierre Wendling 83ec6062 2022-09-18T13:46:09 N3DS: Move gfxInit and hidInit from main to video.
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.
Ryan C. Gordon a2c57573 2022-09-01T10:47:24 video: check for "software" with SDL_HINT_FRAMEBUFFER_ACCELERATION. We check for this value elsewhere but not in SDL_CreateWindowFramebuffer.
Ryan C. Gordon 57b20e7b 2022-09-27T14:23:42 cocoa: Fix new windows setting SDL_WINDOW_BORDERLESS flag incorrectly. Fixes #6172.
Sylvain d71df644 2022-09-27T10:21:15 Fixed bug #6287 - SDL_FillRect failed for SDL_Surface with BitsPerPixel == 4
Frank Praznik 4a06cc0f 2022-09-22T13:03:09 wayland: Apply modifier changes to the text of repeated keys The text component of a repeated keystroke is initially set when a key is first pressed and the cached value remains static until the repeated key is released and another repeatable key is pressed. If the state of a modifier such as shift or capslock is changed while a key is being repeated, the text emitted will not have the modifier applied to it until the repeated key is released and pressed again. Update the text to be repeated by a key if a modifier is changed while a key is actively being repeated.
Frank Praznik 467c82c7 2022-09-23T12:31:40 wayland: Add mappings for the Escape and NumLock keys The XKB keysym to SDL keycode mappings were missing for the Escape and NumLock keys, which prevented them from being remapped. Add them to the table so that the remapping of these keys will work.
UnknownShadow200 5ea9886b 2022-09-23T13:19:22 haiku: Fix when screen color depth was 24 bits, SDL_GetWindowSurface would always fail with 'Unknown pixel format' error Note that returning SDL_PIXELFORMAT_BGR24 instead of SDL_PIXELFORMAT_RGB24 seems necessary, otherwise when running with SDL_ACCELERATION=0, the red and blue channels of the window appeared swapped. Note that when running with acceleration enabled, red and blue channel swapping does not happen regardless of whether SDL_PIXEL_FORMAT_RGB24 or SDL_PIXEL_FORMAT_BGR24 is returned. For good measure, I also tested running with acceleration disabled in both 15 and 16 bit color depths, but red and blue channel swapping did not occur
Frank Praznik 399cb2f0 2022-09-21T13:20:39 wayland: Only clear the key repeat flag when the repeated key is released If multiple keys were simultaneously depressed and one was being repeated, the repeat flag was being cleared when any of the pressed keys were released, even if the released key wasn't the one being repeated. This tracks the key currently being repeated and only clears the repeat flag when the particular key being repeated is released.
past-due 301912a5 2022-09-18T21:25:55 Fix: Use WIN_ClientPointToSDL for converting additional mouse coordinates
Cameron Cawley 8598f05b 2022-09-17T21:45:08 Support loading 2bpp .bmp files
Cameron Cawley 1f7a7fd9 2022-09-17T21:30:40 haiku: Combine HAIKU_ColorSpaceToBitsPerPixel and HAIKU_BPPToSDLPxFormat
Cameron Cawley 43fc6d59 2022-09-08T15:53:54 Fix incorrect return value in X11_GetPixelFormatFromVisualInfo
Ozkan Sezer 5fba31f6 2022-09-17T00:51:00 SDL_HasPrimarySelectionText: fix -Wunreachable-code-return warning.
Sam Lantinga efe01faa 2022-09-16T10:08:31 Replaced Blit4to4CopyAlpha() with optimized SDL_BlitCopy() Fixes https://github.com/libsdl-org/SDL/issues/6241
Ozkan Sezer c0baa6bf 2022-09-16T20:03:50 move SDL_windowstaskdialog.h contents into SDL_windowsmessagebox.c Silences clang -Wpragma warnings: D:/a/SDL/SDL/src/video/windows/SDL_windowstaskdialog.h:21:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] #include <pshpack1.h> ^ D:/a/_temp/msys64/clang64/include/pshpack1.h:7:9: note: previous '#pragma pack' directive that modifies alignment is here #pragma pack(push,1) ^ In file included from D:/a/SDL/SDL/src/video/windows/SDL_windowsmessagebox.c:35: D:/a/SDL/SDL/src/video/windows/SDL_windowstaskdialog.h:156:10: warning: the current #pragma pack alignment value is modified in the included file [-Wpragma-pack] #include <poppack.h> ^ note: previous '#pragma pack' directive that modifies alignment is here 2 warnings generated. Closes: https://github.com/libsdl-org/SDL/issues/6240
Sam Lantinga d744aafb 2022-09-15T01:00:12 Added support for simulated vsync in the renderer This kicks in if the platform doesn't support vsync directly, or if the present fails for some reason (e.g. minimized on some platforms) Fixes https://github.com/libsdl-org/SDL/issues/5134
Ozkan Sezer d86cb8ec 2022-09-16T17:05:02 SDL_offscreenwindow.c: swap include order of SDL_egl_c.h/SDL_sysvideo.h Fixes redefinition warnings from windows builds. Reference issue: https://github.com/libsdl-org/SDL/issues/6239
Sam Lantinga 6de15ffc 2022-09-15T12:04:08 Fixed building offscreen video driver without EGL support Also did miscellaneous style cleanup for consistency with other code
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>`
Sam Lantinga 72fe6cc8 2022-09-14T09:14:47 Updated to the latest version of OpenGL and Vulkan headers from the Khronos registry Fixes https://github.com/libsdl-org/SDL/issues/6193
xeonmc 228b9fb5 2022-09-14T03:43:16 Update SDL_windowswindow.c (#6225) Clip rectangle set to int(left+width/2) , int(top+height/2) , int(left+width/2)+1 , int(top+height/2)+1 a 1x1 box On even-valued resolution, cursor is stable at bottom-right central pixel On odd-valued resolution, cursor is stable at exact central pixel. this is the desired behaviour
Frank Praznik 929d5b80 2022-09-12T22:39:44 wayland: Use the backbuffer size for determining if a resize event is required In some cases, a backbuffer size update may not be accompanied by a resize event if the window size and/or scale were updated before the new backbuffer size was recomputed. Instead of the scale, use the old/new backbuffer sizes to determine if a resize event is required so that a backbuffer size change will always be followed by a resize event.
Frank Praznik edfb00c2 2022-09-09T14:26:44 wayland: Only commit on move if the display was changed Only commit on a move event if the display was changed for a fullscreen window and the compositor has returned bad dimensions.
Frank Praznik 97a5e744 2022-09-06T17:08:27 wayland: Remove duplicate code Wayland_SetWindowSize() can be simplified with the common CommitWindowGeometry() function.
Frank Praznik 78f843f7 2022-09-06T13:19:23 wayland: Remove unnecessary function parameter SetFullscreen() is never called in a case where the commit parameter is false anymore, so the parameter is unnecessary.
Frank Praznik 69e4c770 2022-09-04T12:18:38 video: Make the mode switching function a NOP if mode switching is disabled Instead of wrapping individual calls to SDL_SetDisplayModeForDisplay(), just check the flag in the function itself and make it a NOP that cannot fail if the flag is set. Silences some errant "SDL video driver doesn't support changing display mode" log errors.
Frank Praznik 768b6728 2022-09-04T23:39:05 wayland: Compare against the old scale when resizing Compare against the old scale instead of the new or the conditional will always be true.
Frank Praznik 07aea476 2022-09-03T13:30:49 wayland: Ignore content sizes from libdecor when hiding a window When hiding a window, libdecor can report bogus content region sizes that are +/- the height of the title bar. Ignore any size values from libdecor when hiding a window, or the size may be incorrect when restored.
Frank Praznik 6de12b4a 2022-09-06T13:30:19 wayland: Update the internal state when the compositor moves a fullscreen window The compositor can arbitrarily move windows between displays, including fullscreen windows. Update the internal state when a fullscreen window is moved so the internal SDL state accurately reflects the window location, and resize the window to fit the new display. This also fixes an edge case where the compositor can make a window fullscreen on a different display than SDL thinks it will be on (usually when a window is made fullscreen by the compositor while straddling multiple displays), which can result in the window being incorrectly sized.
Frank Praznik a7d34595 2022-09-03T13:11:29 wayland: Trigger a commit on fullscreen update If additional fullscreen requests are received when the window is already fullscreen, it is typically due to the fullscreen flags or emulated video mode being changed. A commit must be explicitly triggered or the requested changes won't take effect until some other event, such as a resize or focus change, causes the changes to be committed.
Frank Praznik 707b561f 2022-09-03T12:37:02 wayland: Enable compositor fullscreen toggling The compositor can toggle the fullscreen state (via a hotkey or otherwise), so the internal SDL state must be updated accordingly when it does. When toggling fullscreen via the compositor, SDL will attempt to use the last fullscreen flag explicitly set. If no flag was previously set, SDL_WINDOW_FULLSCREEN will be used if a window video mode was set, otherwise SDL_WINDOW_FULLSCREEN_DESKTOP will be used. If the previous flag was SDL_WINDOW_FULLSCREEN and the window video mode was cleared, it will revert to SDL_WINDOW_FULLSCREEN_DESKTOP.
Frank Praznik 31979e2d 2022-09-02T18:41:21 wayland: Add missing static qualifiers
Taiko2k 1c88a052 2022-09-09T16:03:17 Update Wayland cursors to match X11 cursors
Ozkan Sezer 5ffede35 2022-09-06T19:56:29 Fix https://github.com/libsdl-org/SDL/issues/6191
Sylvain 03485db0 2022-09-03T23:40:14 Android: understand HAL_PIXEL_FORMAT_BGR_565 as a returned value from ANativeWindow_getFormat() (see #6016)
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; ^
Mathieu Eyraud b8af865f 2022-08-28T13:02:57 Fix candidate list size for Windows IME Adjust candidate count so list is not draw bigger that needed. This also fix potential uninitialised read of variable `candsize[i]` if `vertical` is false.
Steven Noonan 9ce9c253 2022-08-25T18:41:32 SDL_windowsmodes: fix WIN_GetDisplayNameVista source identifier number This was getting the wrong monitor's name because the source identifier was not being included in the DisplayConfigGetDeviceInfo request.
Anonymous Maarten ce227aa6 2022-08-26T01:57:09 wayland: fix build with SDL_WAYLAND_SHARED=OFF/--enable-wayland-shared=no
DomGries 40b24992 2022-08-25T10:03:33 Fix building with SDL_DISABLE_WINDOWS_IME Regression of https://github.com/libsdl-org/SDL/commit/f317d619ccd22e60cebf1b09d716d3985359c981#diff-bff8f3e638d51e86cb6f0f42e2c527549d649951b7aa5ec4a539e865a5b57027R398
Noel Berry 00452e47 2022-08-24T11:25:13 Adding SDL_GetWindowSizeInPixels for window size in pixels (#6112)
antonino 5f79cd16 2022-08-24T18:50:02 Fixed spacing
antonino dd68eb5c 2022-08-24T17:57:52 free drm prop before returning
antonino aae566e1 2022-08-23T02:26:29 Use SDL_bool
antonino e3ea9b5b 2022-08-23T00:37:43 restore vrr state on exit
antonino 450e9857 2022-08-22T17:58:41 Use SDL_TRUE and SDL_FALSE
antonino 605b50fc 2022-08-22T17:49:49 kmsdrm: added missing checks
Sam Lantinga 20715fa0 2022-08-22T17:09:42 Fixed build errors
Sam Lantinga 92b3c53c 2022-08-22T16:25:25 Added a hint SDL_HINT_MOUSE_RELATIVE_SYSTEM_SCALE to control whether to use system mouse acceleration on raw relative motion. This is currently only implemented on Windows, and "Enhanced pointer precision" mode is not quite correct.
Sam Lantinga d166f5ef 2022-08-22T14:10:54 Fixed uninitialized variable warning
slime b204db1e 2022-08-21T18:06:11 cocoa: change Shape data to use ObjC objects instead of C structs. Fixes #6089
Frank Praznik 057086e3 2022-07-15T13:44:49 wayland: Add high resolution scroll wheel support Update the Wayland core protocol spec file and add support for the new axis_value120 event to handle high resolution scroll wheels. The axis_value120 replaces the axis_discrete event, which is no longer sent as of version 8 of the protocol. Note that unlike the axis_discrete event, no mention in the spec is made regarding how many axis_value120 events may occur per-axis per-frame, so the values are accumulated and committed when the pointer frame event occurs.
Frank Praznik d731ad76 2022-07-15T10:44:38 wayland: Fix include order when building with libdecor The libdecor header internally includes wayland-client.h, which pulls in the wayland-client-protocol.h file from the system include path and overrides the local one generated from the included Wayland protocol spec files. Move the Wayland protocol header inclusion above the libdecor header inclusion to ensure that the locally generated protocol header is used instead.
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 ffab1396 2022-08-19T17:28:31 Fixed minimized window detection when handling WM_WINDOWPOSCHANGED When minimizing a window, we get this sequence of events: WM_WINDOWPOSCHANGING WM_GETMINMAXINFO WM_NCCALCSIZE WM_WINDOWPOSCHANGED - IsIconic() is true WM_MOVE WM_SIZE - SDL sees minimized state here When restoring a window, we get this sequence of events: WM_WINDOWPOSCHANGING WM_GETMINMAXINFO WM_NCCALCSIZE WM_NCPAINT WM_ERASEBKGND WM_WINDOWPOSCHANGED - IsIconic() is false WM_MOVE WM_SIZE - SDL sees restored state here On Windows 10 a minimized window has a non-empty client rect, so we were delivering a minimized size before SDL knows that the window is minimized, and then ignoring the restored size when handling the restore message. The fix is to use IsIconic() which returns the correct window state when WM_WINDOWPOSCHANGED is actually delivered.
Luke Street 2b93f6e1 2022-05-20T09:55:06 cocoa/uikit: Use VK_EXT_metal_surface in Vulkan_GetInstanceExtensions Replaces VK_MVK_macos_surface and VK_MVK_ios_surface
Luke Street 029a9b2f 2022-05-19T12:57:35 cocoa/uikit: Support VK_EXT_metal_surface Uses VK_EXT_metal_surface (vkCreateMetalSurfaceEXT) when possible, otherwise falls back to the obsoleted VK_MVK_macos_surface and VK_MVK_ios_surface. Fixes #3906
antonino ad874536 2022-08-17T14:56:18 kmsdrm: enable vrr on displays that support it
Sam Lantinga 6e007c36 2022-08-18T19:05:55 Add null termination to Wayland_data_source_get_data() if requested Fixes https://github.com/libsdl-org/SDL/issues/6083
Sam Lantinga 948dbe7d 2022-08-18T16:24:20 Don't include the null terminator in Wayland clipboard text Fixes https://github.com/libsdl-org/SDL/issues/6083
Frank Praznik 3bae2d57 2022-08-18T12:39:47 wayland: Set the libdecor app ID after visibility calls Set the frame app ID after toggling visibility or the name displayed in window manager task switchers may not display correctly.
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
Frank Praznik 7da74eb5 2022-08-17T14:59:23 wayland: Never commit with an undefined window title If libdecor performs a commit with the frame title being undefined, a crash can occur within the library or its plugins. Always ensure that the title is set to a valid string to avoid this.
Cameron Cawley 2fcd8f88 2022-08-16T14:19:26 Handle SDL_PIXELFORMAT_EXTERNAL_OES in SDL_GetPixelFormatName()
Ryan C. Gordon 26948f01 2022-08-15T20:09:09 cocoa: Make SDL_MinimizeWindow() work with borderless windows. Fixes #6046.
Frank Praznik 650612fd 2022-08-13T16:54:27 wayland: Eliminate excessive calls to SetFullscreen Eliminate excessive calls to SetFullscreen by removing the calls in the libdecor and xdg-toplevel config callbacks. These calls were being made there in case something explicitly called the window minimization function from within SDL, which unsets fullscreen, and as minimizing a window in Wayland is just a suggestion to the compositor and doesn't actually change the window state or communicate anything back to the application, it was necessary to call SetFullscreen in every call to the config functions just in case something minimized a window via SDL_MinimizeWindow() and later needed to restore it. GNOME in particular had issues when fullscreen set/unset operations were being hammered, leading to overlapping acks and commits when switching to fullscreen. With the new video system flag to disable unsetting fullscreen when minimizing a window, these calls in the configuration functions are no longer needed and can be removed. This significantly reduces calls to the SetFullscreen() function, reverts #6044 while fixing the issue, and fixes a similar problem when hiding and showing a window initially created with fullscreen flags.
Frank Praznik cc9cc202 2022-08-13T16:43:15 video: Add video device quirk flags and apply them to the video subsystem Add quirk flags to the video device struct and add flags to allow video backend drivers to disable mode switching and disable unsetting the fullscreen mode when minimizing a window. As certain platforms can have multiple video backends compiled in at once, #ifdefs, as used by other platforms, aren't suitable as different backends on the same platform may not need the same quirks. This replaces the formerly dedicated 'disable_display_mode_switching' boolean as additional quirks are needed by the Wayland backend. Helper functions have also been added to simplify reading the flag states.
Sam Lantinga 0cc8dfdb 2022-08-15T07:44:56 Added SDL_system.h for the declaration of SDL_iPhoneSetAnimationCallback() and SDL_iPhoneSetEventPump()
Frank Praznik 74bdb211 2022-08-12T22:01:12 wayland: Don't roundtrip in ShowWindow unless restoring a hidden window Don't call the roundtrip in ShowWindow unless restoring a previously hidden window. This fixes a regression in GNOME when creating a window with the fullscreen flag set, as the fullscreen window will be positioned down the screen by the height of the top bar if the window is made fullscreen on the primary display and the roundtrip is called when initially displaying the window.
Cameron Gutman 3046d55d 2022-08-12T22:02:26 cocoa: Return an error if GetWindowDisplayIndex() is called too early SDL_CreateWindow() may call GetWindowDisplayIndex() to compute the position of a new window that the caller has requested to be placed on a certain display. Since we haven't fully constructed the window yet, our driverdata will be nil and we will fail to get the NSScreen (which is fine). However, we need to return an error (not 0, which is a valid display index) for SDL_GetWindowDisplayIndex() to know to figure out the display index itself. Fixes positioning new windows on secondary displays when using SDL_WINDOWPOS_CENTERED_DISPLAY() and SDL_WINDOWPOS_UNDEFINED_DISPLAY().
Sam Lantinga 08d17f47 2022-08-12T20:26:23 Removed unused variable
Sam Lantinga be0cf257 2022-08-12T18:13:42 Only force the resize event in the DPI changed case OpenGL windows don't actually get the WM_WINDOWPOSCHANGED event in the SetWindowPos() call in WIN_SetWindowFullscreen(), so setting the window size to zero never gets reset and we're stuck with a zero sized window. Instead, just force the resize event in WM_DPICHANGED handling, where we know we need it. If we end up needing to force it in WIN_SetWindowFullscreen(), just set a flag in the window data and respond to that in WM_WINDOWPOSCHANGED, but that's a fairly risky behavior change as suddenly all applications would start getting SDL_WINDOWEVENT_SIZE_CHANGED when going fullscreen, and they may respond to that in expensive and potentially disruptive ways. For later we'll probably create a DPI changed event and respond to that in the renderer instead of this window size changed hack. This fixes https://github.com/libsdl-org/SDL/issues/6033 @ericwa
Cameron Gutman 1b08cd20 2022-08-12T18:55:05 wayland: Add roundtrip in SetWindowFullscreen() to get new size The video core assumes that window->w/h will be updated before returning from SetWindowFullscreen(). This is needed to generate a resize event with the correct window size when exiting fullscreen. The roundtrip allows us to receive the configure callback that informs us of the new window size before returning. Fixes #6043