subsurface: Add request_move signal 69/294269/2
authorSeunghun Lee <shiin.lee@samsung.com>
Tue, 30 May 2023 08:20:16 +0000 (17:20 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Mon, 19 Jun 2023 00:37:49 +0000 (00:37 +0000)
This is to inform an exact timing to move a subsurface.

Change-Id: Ib2aaaccbdc6a92bfa7cf7b818cc06a3057414631

include/libds/types/ds_subsurface.h
src/compositor/subsurface.c

index 5fd8346..670daed 100644 (file)
@@ -23,6 +23,7 @@ struct ds_subsurface
     struct {
         struct wl_signal destroy;
         struct wl_signal cached;
+        struct wl_signal request_move;
     } events;
 
     struct {
index 1e1a672..54e5d8d 100644 (file)
@@ -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) {