From 1fc9409df263fe6d3b788042faefaee82a831f32 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Thu, 5 Dec 2024 20:23:29 +0100 Subject: [PATCH] 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 a7ebe7c0267b54621e0aa802632db644d3093f37) --- xwayland/selection/dnd.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/xwayland/selection/dnd.c b/xwayland/selection/dnd.c index a3b9fa7ff..c2f3b4f0b 100644 --- a/xwayland/selection/dnd.c +++ b/xwayland/selection/dnd.c @@ -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);