Set both _NET_WM_NAME and WM_NAME so SDL windows can be shared in the browser.

Fixes https://github.com/libsdl-org/SDL/issues/4924
This commit is contained in:
Sam Lantinga 2021-11-08 07:05:17 -08:00
parent 301819cd1d
commit 6c56e27511
3 changed files with 5 additions and 0 deletions

View File

@ -405,6 +405,7 @@ X11_VideoInit(_THIS)
GET_ATOM(WM_PROTOCOLS); GET_ATOM(WM_PROTOCOLS);
GET_ATOM(WM_DELETE_WINDOW); GET_ATOM(WM_DELETE_WINDOW);
GET_ATOM(WM_TAKE_FOCUS); GET_ATOM(WM_TAKE_FOCUS);
GET_ATOM(WM_NAME);
GET_ATOM(_NET_WM_STATE); GET_ATOM(_NET_WM_STATE);
GET_ATOM(_NET_WM_STATE_HIDDEN); GET_ATOM(_NET_WM_STATE_HIDDEN);
GET_ATOM(_NET_WM_STATE_FOCUSED); GET_ATOM(_NET_WM_STATE_FOCUSED);

View File

@ -93,6 +93,7 @@ typedef struct SDL_VideoData
Atom WM_PROTOCOLS; Atom WM_PROTOCOLS;
Atom WM_DELETE_WINDOW; Atom WM_DELETE_WINDOW;
Atom WM_TAKE_FOCUS; Atom WM_TAKE_FOCUS;
Atom WM_NAME;
Atom _NET_WM_STATE; Atom _NET_WM_STATE;
Atom _NET_WM_STATE_HIDDEN; Atom _NET_WM_STATE_HIDDEN;
Atom _NET_WM_STATE_FOCUSED; Atom _NET_WM_STATE_FOCUSED;

View File

@ -734,6 +734,9 @@ X11_SetWindowTitle(_THIS, SDL_Window * window)
Atom UTF8_STRING = data->videodata->UTF8_STRING; Atom UTF8_STRING = data->videodata->UTF8_STRING;
Atom _NET_WM_NAME = data->videodata->_NET_WM_NAME; Atom _NET_WM_NAME = data->videodata->_NET_WM_NAME;
Atom WM_NAME = data->videodata->WM_NAME;
X11_XChangeProperty(display, data->xwindow, WM_NAME, UTF8_STRING, 8, 0, (const unsigned char *) title, strlen(title));
status = X11_XChangeProperty(display, data->xwindow, _NET_WM_NAME, UTF8_STRING, 8, 0, (const unsigned char *) title, strlen(title)); status = X11_XChangeProperty(display, data->xwindow, _NET_WM_NAME, UTF8_STRING, 8, 0, (const unsigned char *) title, strlen(title));