src/video/os2/SDL_os2video.c


Log

Author Commit Date CI Message
Ryan C. Gordon 20a76b0e 2022-07-25T23:06:58 video: removed unused devindex argument from bootstrap's create method.
Ozkan Sezer 2f216485 2022-07-08T20:56:40 SDL_os2video.c: silenced -Wempty-body warning, along with minor tidy-up.
Sam Lantinga adc68758 2022-06-17T10:22:28 Added SDL_copyp to avoid size mismatch when copying values (thanks @1bsyl!) Closes https://github.com/libsdl-org/SDL/pull/5811
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>
Ozkan Sezer afb0606f 2022-03-10T18:50:10 minor os/2 clean-ups.
Ozkan Sezer c8cee0b8 2022-02-04T23:28:56 OS2_HasClipboardText: store the boolean result before closing clipboard. just in case..
Ozkan Sezer 3b9e6c1c 2022-02-04T19:50:20 SDL_os2video.c: fixed HasClipboardText() semantics. Empty string in clipboard is expected to give FALSE by SDL_HasClipboardText. Noticed in a commit by josch1710 in bitwiseworks' os/2 fork.
Sam Lantinga 120c76c8 2022-01-03T09:40:00 Updated copyright for 2022
Ozkan Sezer 8d14e6ea 2021-12-08T14:01:02 replaced use of _MAX_PATH with CCHMAXPATH in os/2 code, it now compiles without HAVE_LIBC
Ozkan Sezer 662ea5ab 2021-12-01T01:40:24 minor correction after previous patch and minor tidy-up.
Ozkan Sezer 70c5e91d 2021-12-01T01:20:10 os/2 optionally builds against libiconv.
Ozkan Sezer 0a0f6854 2021-10-18T14:10:56 SDL_os2video.c: missed replacing a use of libc function
Ozkan Sezer e92a639b 2021-10-04T23:00:28 replaced many uses of libc calls with SDL_ counterparts in os2 sources. TODO: core/os2 and geniconv sources _must_ be updated, as well..
Ozkan Sezer bc9888c9 2021-06-12T14:55:24 OS2_GetDisplayModes: malloc a new copy of mode's driver data. Based on a patch by Jochen Schäfer <josch1710@live.de> : The problem is, that in the initialization code uses the same structure for desktop_mode and current_mode. See SDL_os2video.c:OS2_VideoInit(): stSDLDisplay.desktop_mode = stSDLDisplayMode; stSDLDisplay.current_mode = stSDLDisplayMode; ... stSDLDisplayMode.driverdata = pDisplayData; Then, if you call GetDisplayModes, current_mode will added to the modes list, with the same driverdata pointer to desktop_mode. SDL_AddDisplayMode( display, &display->current_mode ); When VideoQuit gets called, first the modes list gets freed including the driverdata, the desktop_mode gets freed. See SDL_video.c:SDL_VideoQuit(): for (j = display->num_display_modes; j--;) { SDL_free(display->display_modes[j].driverdata); display->display_modes[j].driverdata = NULL; } SDL_free(display->display_modes); display->display_modes = NULL; SDL_free(display->desktop_mode.driverdata); display->desktop_mode.driverdata = NULL; So, the display_modes[j].driverdata gets freed, but desktop_mode->driverdata points to the same memory, but is not NULL'ed. When desktop_mode->driverdata gets freed the memory is already freed, and libcx crashes the application on SDL_Quit.
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()
Sam Lantinga 9130f7c3 2021-01-02T10:25:38 Updated copyright for 2021
Ozkan Sezer c70191d2 2020-10-17T07:37:00 SDL_os2video.c (OS2_CreateDevice): remove duplicated assignment.
Ozkan Sezer 77d0f043 2020-10-16T23:50:00 os2video.c: add missing FOURCC_R666 define, enable FOURCC_R666 case in _getSDLPixelFormatData().
Ozkan Sezer a90f0400 2020-10-15T21:37:30 os2: a _lot_ of coding style cleanup, sot that they match the SDL style. also renamed the 'debug' macro to debug_os2: the former was dangerously a common name. the binary (dll) output is precisely the same as before.
Ozkan Sezer 1d9cf23e 2020-10-14T23:01:05 os2: updated copyright dates for 2020. header guard fixes.
Ozkan Sezer fe2cc8d8 2020-10-14T23:01:04 OS2_VideoQuit(): avoid double free()ing of displays. Our caller SDL_VideoQuit() already frees display_modes, driverdata, etc. Noticed in bitwiseworks' version at https://github.com/bitwiseworks/SDL2-os2
Ozkan Sezer fba32ee2 2020-10-14T23:01:04 OS2_VideoInit: zero the stSDLDisplay and stSDLDisplayMode variables Fixes testdisplayinfo.exe crashing in SDL2-2.0.13. (How it did work before?..)
Ozkan Sezer 54ced668 2020-10-14T23:01:04 port from 2.0.12 to 2.0.13 / current SDL-hg repository. - video: VideoBootStrap->available() is gone. - thread: all important SDL_CreateThread internal data now put into struct SDL_Thread: changes to SDL_SYS_CreateThread().
Ozkan Sezer 5da796fe 2020-10-14T23:01:03 os/2: port from SDL2-2.0.5 to SDL2-2.0.12 - events / video: SDL_SetDoubleClickTime() removed -- functionality moved to SDL_mouse.c:SDL_MouseDoubleClickTimeChanged(). - video: struct SDL_VideoDevice-> CreateWindow and CreateWindowFrom members renamed to CreateSDLWindow and CreateSDLWindowFrom
Ozkan Sezer 222f0268 2020-10-14T23:01:03 os/2: port from SDL2-2.0.4 to SDL2-2.0.5: changes to SDL_os2audio.c, SDL_os2video.c, os2/SDL_systhread.c in order to accomodate SDL2-2.0.5 changes. - audio: WaitDone() is gone, CloseDevice() interface changes. - events / video: DropFile() changes: SDL_DROPBEGIN and SDL_DROPCOMPLETE events, window IDs for drops. - thread: struct SDL_Thread->stacksize
Ozkan Sezer 1b99d805 2020-10-14T23:01:02 os2: updates from Andrey Vasilkin's 2020-09-07 sources.
Ozkan Sezer aa790837 2020-10-14T23:01:02 os2: several warning fixes. mostly those "W007: '&array' may not produce intended result" warnings from Watcom, visible only in C++ mode. one or two others here & there.
Ozkan Sezer 74cfb81d 2020-10-14T23:01:00 os2: add port files for SDL2-2.0.4 from Andrey Vasilkin only geniconv/iconv.h (was from LGPL libiconv) is replaced with a generic minimal iconv.h based on public knowledge.