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.
This commit is contained in:
Jos Dehaes 2026-04-15 14:35:27 +02:00 committed by Johan Malm
parent 7b3f37725f
commit fe6ea66b82

View file

@ -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