xwayland: remove loop to find drag focus surface

We can just use wlr_xwayland_surface_try_from_wlr_surface() here
instead.

(cherry picked from commit a7ebe7c026)
This commit is contained in:
Simon Ser 2024-12-05 20:23:29 +01:00 committed by Simon Zeni
parent 885bf8f5e8
commit 1fc9409df2

View file

@ -271,14 +271,7 @@ static void seat_handle_drag_focus(struct wl_listener *listener, void *data) {
struct wlr_xwayland_surface *focus = NULL;
if (drag->focus != NULL) {
// TODO: check for subsurfaces?
struct wlr_xwayland_surface *surface;
wl_list_for_each(surface, &xwm->surfaces, link) {
if (surface->surface == drag->focus) {
focus = surface;
break;
}
}
focus = wlr_xwayland_surface_try_from_wlr_surface(drag->focus);
}
xwm_set_drag_focus(xwm, focus);