From c752270be78d8e05fed23096da1643f89ffa0d53 Mon Sep 17 00:00:00 2001 From: Kirill Primak Date: Mon, 9 Sep 2024 19:27:24 +0300 Subject: [PATCH] tinywl: drop focused surface check for interactive ops This serves as a bad example: compositors should validate serials from events instead. Also, the current implementation segfaults if focused_surface is NULL. --- tinywl/tinywl.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/tinywl/tinywl.c b/tinywl/tinywl.c index edc6269b..6cf08b11 100644 --- a/tinywl/tinywl.c +++ b/tinywl/tinywl.c @@ -712,13 +712,7 @@ static void begin_interactive(struct tinywl_toplevel *toplevel, * compositor stops propegating pointer events to clients and instead * consumes them itself, to move or resize windows. */ struct tinywl_server *server = toplevel->server; - struct wlr_surface *focused_surface = - server->seat->pointer_state.focused_surface; - if (toplevel->xdg_toplevel->base->surface != - wlr_surface_get_root_surface(focused_surface)) { - /* Deny move/resize requests from unfocused clients. */ - return; - } + server->grabbed_toplevel = toplevel; server->cursor_mode = mode;