From ebecc5404b899b462f4c414663780ba72adbab28 Mon Sep 17 00:00:00 2001 From: Kenny Levinsen Date: Sat, 7 Nov 2020 22:08:40 +0100 Subject: surface: Make send_enter store entered outputs wlr_surface_send_enter now stores outputs that have been entered. Combined with a new 'bind' event on wlr_output, this allows us to delay enter events as necessary until the respective wl_output global has been bound. Closes: https://github.com/swaywm/wlroots/issues/2466 --- include/wlr/types/wlr_output.h | 7 +++++++ include/wlr/types/wlr_surface.h | 11 +++++++++++ 2 files changed, 18 insertions(+) (limited to 'include/wlr') diff --git a/include/wlr/types/wlr_output.h b/include/wlr/types/wlr_output.h index cb742706..8cc4afcf 100644 --- a/include/wlr/types/wlr_output.h +++ b/include/wlr/types/wlr_output.h @@ -166,6 +166,8 @@ struct wlr_output { struct wl_signal commit; // wlr_output_event_commit // Emitted right after the buffer has been presented to the user struct wl_signal present; // wlr_output_event_present + // Emitted after a client bound the wl_output global + struct wl_signal bind; // wlr_output_event_bind struct wl_signal enable; struct wl_signal mode; struct wl_signal scale; @@ -233,6 +235,11 @@ struct wlr_output_event_present { uint32_t flags; // enum wlr_output_present_flag }; +struct wlr_output_event_bind { + struct wlr_output *output; + struct wl_resource *resource; +}; + struct wlr_surface; /** diff --git a/include/wlr/types/wlr_surface.h b/include/wlr/types/wlr_surface.h index 2cd4ac5d..abb05600 100644 --- a/include/wlr/types/wlr_surface.h +++ b/include/wlr/types/wlr_surface.h @@ -67,6 +67,15 @@ struct wlr_surface_role { void (*precommit)(struct wlr_surface *surface); }; +struct wlr_surface_output { + struct wlr_surface *surface; + struct wlr_output *output; + + struct wl_list link; // wlr_surface::current_outputs + struct wl_listener bind; + struct wl_listener destroy; +}; + struct wlr_surface { struct wl_resource *resource; struct wlr_renderer *renderer; @@ -126,6 +135,8 @@ struct wlr_surface { // wlr_subsurface::parent_pending_link struct wl_list subsurface_pending_list; + struct wl_list current_outputs; // wlr_surface_output::link + struct wl_listener renderer_destroy; void *data; -- cgit v1.2.3