From ced2a7f732a6bc9c4dd1ec27791cd5522c0ac320 Mon Sep 17 00:00:00 2001
From: DreamMaoMao <2523610504@qq.com>
Date: Mon, 12 May 2025 10:30:35 +0800
Subject: [PATCH] feat: support ipc to get geom message
---
protocols/dwl-ipc-unstable-v2.xml | 29 +++++++++++++++++++++++++++++
src/maomao.c | 20 ++++++++++++++++++++
2 files changed, 49 insertions(+)
diff --git a/protocols/dwl-ipc-unstable-v2.xml b/protocols/dwl-ipc-unstable-v2.xml
index e24f367..81ab022 100644
--- a/protocols/dwl-ipc-unstable-v2.xml
+++ b/protocols/dwl-ipc-unstable-v2.xml
@@ -190,6 +190,35 @@ I would probably just submit raphi's patchset but I don't think that would be po
+
+
+
+ Indicates if x coordinates of the selected client.
+
+
+
+
+
+
+ Indicates if y coordinates of the selected client.
+
+
+
+
+
+
+ Indicates if width of the selected client.
+
+
+
+
+
+
+ Indicates if height of the selected client.
+
+
+
+
diff --git a/src/maomao.c b/src/maomao.c
index b54560a..74178cc 100644
--- a/src/maomao.c
+++ b/src/maomao.c
@@ -3565,6 +3565,26 @@ void dwl_ipc_output_printstatus_to(DwlIpcOutput *ipc_output) {
zdwl_ipc_output_v2_send_floating(ipc_output->resource,
focused ? focused->isfloating : 0);
}
+ if (wl_resource_get_version(ipc_output->resource) >=
+ ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_x(ipc_output->resource,
+ focused ? focused->geom.x : 0);
+ }
+ if (wl_resource_get_version(ipc_output->resource) >=
+ ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_y(ipc_output->resource,
+ focused ? focused->geom.y : 0);
+ }
+ if (wl_resource_get_version(ipc_output->resource) >=
+ ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_width(ipc_output->resource,
+ focused ? focused->geom.width : 0);
+ }
+ if (wl_resource_get_version(ipc_output->resource) >=
+ ZDWL_IPC_OUTPUT_V2_FLOATING_SINCE_VERSION) {
+ zdwl_ipc_output_v2_send_height(ipc_output->resource,
+ focused ? focused->geom.height : 0);
+ }
zdwl_ipc_output_v2_send_frame(ipc_output->resource);
}