mirror of
https://github.com/swaywm/sway.git
synced 2026-04-05 07:15:41 -04:00
Introduce surface_{enter,leave}_output()
We can centralize all output-related surface events from there.
This commit is contained in:
parent
8e4b659578
commit
1cab17ada2
6 changed files with 30 additions and 11 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue