text_input: Fix ime panic in ext-session-lock

in the origin text_input.c, we only check the sway_view and layershell,
but now we have the third shell named sessionlock, so we need to modify
both text_input.c and view.c to handle the new type of shell
This commit is contained in:
ShootingStarDragons 2025-03-20 21:58:21 +09:00 committed by Simon Ser
parent 30434b2beb
commit d148560f50
2 changed files with 29 additions and 0 deletions

View file

@ -12,6 +12,7 @@
#include <wlr/types/wlr_server_decoration.h>
#include <wlr/types/wlr_subcompositor.h>
#include <wlr/types/wlr_xdg_decoration_v1.h>
#include <wlr/types/wlr_session_lock_v1.h>
#if WLR_HAS_XWAYLAND
#include <wlr/xwayland.h>
#endif
@ -1010,6 +1011,9 @@ struct sway_view *view_from_wlr_surface(struct wlr_surface *wlr_surface) {
if (wlr_layer_surface_v1_try_from_wlr_surface(wlr_surface) != NULL) {
return NULL;
}
if (wlr_session_lock_surface_v1_try_from_wlr_surface(wlr_surface) != NULL) {
return NULL;
}
const char *role = wlr_surface->role ? wlr_surface->role->name : NULL;
sway_log(SWAY_DEBUG, "Surface of unknown type (role %s): %p",