Commit Graph

30 Commits

Author SHA1 Message Date
Ryan C. Gordon 7d7ec9c951
x11: Remove XVidMode and Xinerama support.
Fixes #1782.
2022-04-26 23:17:13 -04:00
Sam Lantinga 120c76c84b Updated copyright for 2022 2022-01-03 09:40:21 -08:00
Fredrick Brennan 367684b0c2 Add patches suggested by @slouken in round 1 review 2021-11-28 21:00:29 -08:00
Fredrick Brennan 9c03d25543 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:
d7d98751b7,
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 😂
2021-11-28 21:00:29 -08:00
Ethan Lee 4b42c05ba1 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.
2021-11-08 14:16:54 -08:00
Cacodemon345 19dee1cd16
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
2021-10-21 17:37:20 -07:00
Sam Lantinga ff1b5e1bf7 Implemented the window flash operations for X11 2021-07-24 15:11:36 -07:00
Sam Lantinga f1633127d1 Added a window flash operation to be explicit about window flash behavior 2021-07-24 13:42:19 -07:00
Sam Lantinga e1c3a25034 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 2021-07-24 12:11:27 -07:00
Jupeyy 64724db0a1 Implement bare minimum for SDL_FlashWindow 2021-06-04 15:07:55 -07:00
Cacodemon345 0838f53d5a Implement SDL_SetWindowAlwaysOnTop for X11 2021-04-21 13:09:10 -04:00
Cameron Gutman a0d3c6c63c Rename SetWindowGrab() to SetWindowMouseGrab() 2021-02-10 10:22:16 -05:00
Cameron Gutman e1f73e642b 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.
2021-02-10 10:22:16 -05:00
Sam Lantinga 9130f7c377 Updated copyright for 2021 2021-01-02 10:25:38 -08:00
Sam Lantinga a8780c6a28 Updated copyright date for 2020 2020-01-16 20:49:25 -08:00
Sam Lantinga 5e13087b0f Updated copyright for 2019 2019-01-04 22:01:14 -08:00
Ryan C. Gordon e061a92dc9 Some drag'and'drop improvements.
First: disable d'n'd events by default; most apps don't need these at all, and
if an app doesn't explicitly handle these, each drop on the window will cause
a memory leak if the events are enabled. This follows the guidelines we have
for SDL_TEXTINPUT events already.

Second: when events are enabled or disabled, signal the video layer, as it
might be able to inform the OS, causing UI changes or optimizations (for
example, dropping a file icon on a Cocoa app that isn't accepting drops will
cause macOS to show a rejection animation instead of the drop operation just
vanishing into the ether, X11 might show a different cursor when dragging
onto an accepting window, etc).

Third: fill in the drop event details in the test library and enable the
events in testwm.c for making sure this all works as expected.
2018-08-02 16:03:47 -04:00
Sam Lantinga e3cc5b2c6b Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga 45b774e3f7 Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga 3615633571 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Ryan C. Gordon 4f4c4b629f Added SDL_SetWindowResizable(). (thanks, Ethan!) 2016-09-29 22:52:41 -04:00
Sam Lantinga 67bdbcca44 Implemented SDL_HINT_MOUSE_FOCUS_CLICKTHROUGH on X11 2016-09-29 16:05:29 -07:00
Ryan C. Gordon 02f49fdb53 x11: Deal with window borders better.
- Cache the _NET_FRAME_EXTENTS data locally, so we don't have to query
the X server for them (instead, we update our cached data when PropertyNotify
events alert us to a change).

- Use our cached extents for X11_GetWindowBordersSize(), so it's a fast call.

- Window position was meant to refer to the client area, not the window
decorations, so adjust appropriately when getting/setting the position.
2016-03-04 18:47:19 -05:00
Ryan C. Gordon d4aedf9951 Added SDL_SetWindowModalFor().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2015-04-21 09:45:58 -04:00
Ryan C. Gordon e497e46515 Added SDL_SetWindowInputFocus().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2016-01-05 02:28:56 -05:00
Ryan C. Gordon 3bdaf4c611 Added SDL_SetWindowOpacity() and SDL_GetWindowOpacity().
This is currently implemented for X11, Cocoa, Windows, and DirectFB.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2016-01-05 02:46:10 -05:00
Ryan C. Gordon 5696e88e6b Added SDL_GetWindowBordersSize().
This is currently only implemented for X11.

This patch is based on work in Unreal Engine 4's fork of SDL,
compliments of Epic Games.
2016-01-05 02:29:06 -05:00
Ryan C. Gordon 6df5e1e535 x11: Support _NET_WM_USER_TIME and give _NET_ACTIVE_WINDOW a valid timestamp.
Fixes Bugzilla #3056.
2016-01-04 16:25:27 -05:00
Sam Lantinga 42065e785d Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Philipp Wiesemann 0e45984fa0 Fixed crash if initialization of EGL failed but was tried again later.
The internal function SDL_EGL_LoadLibrary() did not delete and remove a mostly
uninitialized data structure if loading the library first failed. A later try to
use EGL then skipped initialization and assumed it was previously successful
because the data structure now already existed. This led to at least one crash
in the internal function SDL_EGL_ChooseConfig() because a NULL pointer was
dereferenced to make a call to eglBindAPI().
2015-06-21 17:33:46 +02:00