mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-10-29 05:40:12 -04:00
Don't assume xdg_surface.{toplevel,popup} is non-NULL
This assumption will become incorrect with future commits.
This commit is contained in:
parent
f0cc712af1
commit
10ba8ebc70
4 changed files with 44 additions and 20 deletions
|
|
@ -122,7 +122,9 @@ static void focus_view(struct tinywl_view *view, struct wlr_surface *surface) {
|
|||
struct wlr_xdg_surface *previous =
|
||||
wlr_xdg_surface_try_from_wlr_surface(seat->keyboard_state.focused_surface);
|
||||
assert(previous != NULL && previous->role == WLR_XDG_SURFACE_ROLE_TOPLEVEL);
|
||||
wlr_xdg_toplevel_set_activated(previous->toplevel, false);
|
||||
if (previous->toplevel != NULL) {
|
||||
wlr_xdg_toplevel_set_activated(previous->toplevel, false);
|
||||
}
|
||||
}
|
||||
struct wlr_keyboard *keyboard = wlr_seat_get_keyboard(seat);
|
||||
/* Move the view to the front */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue