Introduce surface_{enter,leave}_output()

We can centralize all output-related surface events from there.
This commit is contained in:
Simon Ser 2023-02-08 15:25:14 +01:00 committed by Kenny Levinsen
parent 8e4b659578
commit 1cab17ada2
6 changed files with 30 additions and 11 deletions

View file

@ -4,6 +4,7 @@
#include <wlr/types/wlr_compositor.h>
#include "sway/server.h"
#include "sway/surface.h"
#include "sway/output.h"
static void handle_destroy(struct wl_listener *listener, void *data) {
struct sway_surface *surface = wl_container_of(listener, surface, destroy);
@ -44,3 +45,13 @@ void handle_compositor_new_surface(struct wl_listener *listener, void *data) {
wl_resource_post_no_memory(wlr_surface->resource);
}
}
void surface_enter_output(struct wlr_surface *surface,
struct sway_output *output) {
wlr_surface_send_enter(surface, output->wlr_output);
}
void surface_leave_output(struct wlr_surface *surface,
struct sway_output *output) {
wlr_surface_send_leave(surface, output->wlr_output);
}