Skip to content

Commit

Permalink
wlserver: Call wlr_xdg_toplevel_set_activated for Wayland windows
Browse files Browse the repository at this point in the history
  • Loading branch information
misyltoad committed Sep 26, 2023
1 parent 2baad51 commit 6a8500f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/wlserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,8 @@ static struct wl_listener new_input_listener = { .notify = wlserver_new_input };

wlserver_wl_surface_info *get_wl_surface_info(struct wlr_surface *wlr_surf)
{
if (!wlr_surf)
return NULL;
return reinterpret_cast<wlserver_wl_surface_info *>(wlr_surf->data);
}

Expand Down Expand Up @@ -1552,6 +1554,16 @@ void wlserver_keyboardfocus( struct wlr_surface *surface )
{
assert( wlserver_is_lock_held() );

if (wlserver.kb_focus_surface != surface) {
auto old_wl_surf = get_wl_surface_info( wlserver.kb_focus_surface );
if (old_wl_surf && old_wl_surf->xdg_surface && old_wl_surf->xdg_surface->xdg_toplevel)
wlr_xdg_toplevel_set_activated(old_wl_surf->xdg_surface->xdg_toplevel, false);

auto new_wl_surf = get_wl_surface_info( surface );
if (new_wl_surf && new_wl_surf->xdg_surface && new_wl_surf->xdg_surface->xdg_toplevel)
wlr_xdg_toplevel_set_activated(new_wl_surf->xdg_surface->xdg_toplevel, true);
}

assert( wlserver.wlr.virtual_keyboard_device != nullptr );
wlr_seat_set_keyboard( wlserver.wlr.seat, wlserver.wlr.virtual_keyboard_device );

Expand Down

0 comments on commit 6a8500f

Please sign in to comment.