From 76a2630e4934dac79e1d8df267b41ba6b49c7fc3 Mon Sep 17 00:00:00 2001 From: Seunghun Lee Date: Tue, 30 May 2023 17:20:16 +0900 Subject: [PATCH] subsurface: Add request_move signal This is to inform an exact timing to move a subsurface. Change-Id: Ib2aaaccbdc6a92bfa7cf7b818cc06a3057414631 --- include/libds/types/ds_subsurface.h | 1 + src/compositor/subsurface.c | 3 +++ 2 files changed, 4 insertions(+) diff --git a/include/libds/types/ds_subsurface.h b/include/libds/types/ds_subsurface.h index 5fd8346..670daed 100644 --- a/include/libds/types/ds_subsurface.h +++ b/include/libds/types/ds_subsurface.h @@ -23,6 +23,7 @@ struct ds_subsurface struct { struct wl_signal destroy; struct wl_signal cached; + struct wl_signal request_move; } events; struct { diff --git a/src/compositor/subsurface.c b/src/compositor/subsurface.c index 1e1a672..54e5d8d 100644 --- a/src/compositor/subsurface.c +++ b/src/compositor/subsurface.c @@ -55,6 +55,7 @@ create_subsurface(struct wl_resource *subcomp_resource, wl_signal_init(&subsurface->events.destroy); wl_signal_init(&subsurface->events.cached); + wl_signal_init(&subsurface->events.request_move); subsurface_link_surface(subsurface, surface); subsurface_link_parent(subsurface, parent); @@ -109,6 +110,8 @@ subsurface_parent_commit(struct ds_subsurface *subsurface, bool synchronized) subsurface->current.y != subsurface->pending.y) { subsurface->current.x = subsurface->pending.x; subsurface->current.y = subsurface->pending.y; + + wl_signal_emit_mutable(&subsurface->events.request_move, subsurface); } if (synchronized || subsurface->synchronized) { -- 2.7.4