Skip to content

Commit fe9bdcf

Browse files
committed
Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT
1 parent 9f55794 commit fe9bdcf

File tree

3 files changed

+27
-1
lines changed

3 files changed

+27
-1
lines changed

WhatsNew.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11

22
This is a list of major changes in SDL's version history.
33

4+
---------------------------------------------------------------------------
5+
3.2.10:
6+
---------------------------------------------------------------------------
7+
* Added SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT to control whether XSelectInput() should be called on external windows to enable input events.
8+
9+
---------------------------------------------------------------------------
10+
3.2.4:
11+
---------------------------------------------------------------------------
12+
* Added SDL_StretchSurface()
13+
414
---------------------------------------------------------------------------
515
3.2.0:
616
---------------------------------------------------------------------------

include/SDL3/SDL_hints.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3607,6 +3607,20 @@ extern "C" {
36073607
*/
36083608
#define SDL_HINT_VIDEO_WIN_D3DCOMPILER "SDL_VIDEO_WIN_D3DCOMPILER"
36093609

3610+
/**
3611+
* A variable controlling whether SDL should call XSelectInput() to enable input events on X11 windows wrapped by SDL windows.
3612+
*
3613+
* The variable can be set to the following values:
3614+
*
3615+
* - "0": Don't call XSelectInput(), assuming the native window code has done it already.
3616+
* - "1": Call XSelectInput() to enable input events. (default)
3617+
*
3618+
* This hint should be set before creating a window.
3619+
*
3620+
* \since This hint is available since SDL 3.2.10.
3621+
*/
3622+
#define SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT "SDL_VIDEO_X11_EXTERNAL_WINDOW_INPUT"
3623+
36103624
/**
36113625
* A variable controlling whether the X11 _NET_WM_BYPASS_COMPOSITOR hint
36123626
* should be used.

src/video/x11/SDL_x11window.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,9 @@ bool X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window, SDL_Properties
521521
return false;
522522
}
523523

524-
SetupWindowInput(_this, window);
524+
if (SDL_GetHintBoolean(SDL_HINT_VIDEO_X11_EXTERNAL_WINDOW_INPUT, true)) {
525+
SetupWindowInput(_this, window);
526+
}
525527
return true;
526528
}
527529

0 commit comments

Comments
 (0)