Skip to content

Commit

Permalink
Set both _NET_WM_NAME and WM_NAME so SDL windows can be shared in the…
Browse files Browse the repository at this point in the history
… browser.

Fixes libsdl-org#4924
  • Loading branch information
slouken committed Nov 8, 2021
1 parent 301819c commit 6c56e27
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/video/x11/SDL_x11video.c
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,7 @@ X11_VideoInit(_THIS)
GET_ATOM(WM_PROTOCOLS);
GET_ATOM(WM_DELETE_WINDOW);
GET_ATOM(WM_TAKE_FOCUS);
GET_ATOM(WM_NAME);
GET_ATOM(_NET_WM_STATE);
GET_ATOM(_NET_WM_STATE_HIDDEN);
GET_ATOM(_NET_WM_STATE_FOCUSED);
Expand Down
1 change: 1 addition & 0 deletions src/video/x11/SDL_x11video.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ typedef struct SDL_VideoData
Atom WM_PROTOCOLS;
Atom WM_DELETE_WINDOW;
Atom WM_TAKE_FOCUS;
Atom WM_NAME;
Atom _NET_WM_STATE;
Atom _NET_WM_STATE_HIDDEN;
Atom _NET_WM_STATE_FOCUSED;
Expand Down
3 changes: 3 additions & 0 deletions src/video/x11/SDL_x11window.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,6 +734,9 @@ X11_SetWindowTitle(_THIS, SDL_Window * window)

Atom UTF8_STRING = data->videodata->UTF8_STRING;
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));

Expand Down

0 comments on commit 6c56e27

Please sign in to comment.