Skip to content

Commit

Permalink
wayland: Activate the window on first ShowWindow, if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Jun 2, 2021
1 parent 57d1946 commit 913ed06
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/video/wayland/SDL_waylandwindow.c
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,19 @@ void Wayland_ShowWindow(_THIS, SDL_Window *window)
if (window->flags & SDL_WINDOW_BORDERLESS) {
Wayland_SetWindowBordered(_this, window, SDL_FALSE);
}

/* We're finally done putting the window together, raise if possible */
if (c->activation_manager) {
const char *activation_token = SDL_getenv("XDG_ACTIVATION_TOKEN");
if (activation_token && *activation_token != '\0') {
xdg_activation_v1_activate(c->activation_manager,
activation_token,
data->surface);

/* Clear this variable, per the protocol's request */
SDL_setenv("XDG_ACTIVATION_TOKEN", "", 1);
}
}
}

void Wayland_HideWindow(_THIS, SDL_Window *window)
Expand Down

0 comments on commit 913ed06

Please sign in to comment.