From fe6ea66b8221ac77edba84e9efe30ef417553804 Mon Sep 17 00:00:00 2001 From: Jos Dehaes Date: Wed, 15 Apr 2026 14:35:27 +0200 Subject: [PATCH] server: add pending auto-raise state + decl Add two fields to struct server: struct view *pending_auto_raise_view; struct wl_event_source *pending_auto_raise_timer; and forward-declare desktop_cancel_pending_auto_raise() in labwc.h. The state is a single 'slot' (at most one view/timer pending) since a new focus change supersedes any previous pending raise. This commit just reserves the state and the public API; the behaviour is implemented in the following commit. --- include/labwc.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/labwc.h b/include/labwc.h index 511fdd65..dc4c1311 100644 --- a/include/labwc.h +++ b/include/labwc.h @@ -150,6 +150,11 @@ struct seat { struct server { struct wl_display *wl_display; struct wl_event_loop *wl_event_loop; /* Can be used for timer events */ + + /* Pending auto-raise timer (used when rc.raise_on_focus_delay_ms > 0) */ + struct view *pending_auto_raise_view; + struct wl_event_source *pending_auto_raise_timer; + struct wlr_renderer *renderer; struct wlr_allocator *allocator; struct wlr_backend *backend; @@ -343,6 +348,13 @@ void xdg_shell_finish(void); */ void desktop_focus_view(struct view *view, bool raise); +/** + * desktop_cancel_pending_auto_raise() - cancel any pending delayed auto-raise + * (from raiseOnFocusDelay). Called when a view is being destroyed, on config + * reload, or when a new focus change with raise=false supersedes the pending. + */ +void desktop_cancel_pending_auto_raise(void); + /** * desktop_focus_view_or_surface() - like desktop_focus_view() but can * also focus other (e.g. xwayland-unmanaged) surfaces