update sdl Merge commit '644725478f4de0f074a6834e8423ac36dce3974f'

This commit is contained in:
2023-09-23 18:53:11 +02:00
172 changed files with 7495 additions and 4062 deletions

View File

@@ -238,7 +238,7 @@ Uint32 X11_GetNetWMState(SDL_VideoDevice *_this, SDL_Window *window, Window xwin
for (i = 0; i < numItems; ++i) {
if (atoms[i] == _NET_WM_STATE_HIDDEN) {
flags |= SDL_WINDOW_HIDDEN;
flags |= SDL_WINDOW_MINIMIZED | SDL_WINDOW_OCCLUDED;
} else if (atoms[i] == _NET_WM_STATE_FOCUSED) {
flags |= SDL_WINDOW_INPUT_FOCUS;
} else if (atoms[i] == _NET_WM_STATE_MAXIMIZED_VERT) {
@@ -604,8 +604,14 @@ int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
return SDL_SetError("Couldn't create window");
}
SetWindowBordered(display, screen, w,
!(window->flags & SDL_WINDOW_BORDERLESS));
/* Do not set borderless window if in desktop fullscreen, this causes
flickering in multi-monitor setups */
if (!((window->pending_flags & SDL_WINDOW_FULLSCREEN) &&
(window->flags & SDL_WINDOW_BORDERLESS) &&
!window->fullscreen_exclusive)) {
SetWindowBordered(display, screen, w,
!(window->flags & SDL_WINDOW_BORDERLESS));
}
sizehints = X11_XAllocSizeHints();
/* Setup the normal size hints */
@@ -623,7 +629,7 @@ int X11_CreateWindow(SDL_VideoDevice *_this, SDL_Window *window)
/* Setup the input hints so we get keyboard input */
wmhints = X11_XAllocWMHints();
wmhints->input = True;
wmhints->input = !(window->flags & SDL_WINDOW_NOT_FOCUSABLE) ? True : False;
wmhints->window_group = data->window_group;
wmhints->flags = InputHint | WindowGroupHint;
@@ -1982,4 +1988,24 @@ void X11_ShowWindowSystemMenu(SDL_Window *window, int x, int y)
X11_XFlush(display);
}
int X11_SetWindowFocusable(SDL_VideoDevice *_this, SDL_Window *window, SDL_bool focusable)
{
SDL_WindowData *data = window->driverdata;
Display *display = data->videodata->display;
XWMHints *wmhints;
wmhints = X11_XGetWMHints(display, data->xwindow);
if (wmhints == NULL) {
return SDL_SetError("Couldn't get WM hints");
}
wmhints->input = focusable ? True : False;
wmhints->flags |= InputHint;
X11_XSetWMHints(display, data->xwindow, wmhints);
X11_XFree(wmhints);
return 0;
}
#endif /* SDL_VIDEO_DRIVER_X11 */