feat: support ipc to get geom message

This commit is contained in:
DreamMaoMao 2025-05-12 10:30:35 +08:00
parent 2a034bbadd
commit ced2a7f732
2 changed files with 49 additions and 0 deletions

View file

@ -190,6 +190,35 @@ I would probably just submit raphi's patchset but I don't think that would be po
</description>
<arg name="is_floating" type="uint" summary="If the selected client is floating. Nonzero is valid, zero invalid"/>
</event>
<event name="x" since="2">
<description summary="Update the x coordinates">
Indicates if x coordinates of the selected client.
</description>
<arg name="x" type="int" summary="x coordinate of the selected client"/>
</event>
<event name="y" since="2">
<description summary="Update the y coordinates">
Indicates if y coordinates of the selected client.
</description>
<arg name="y" type="int" summary="y coordinate of the selected client"/>
</event>
<event name="width" since="2">
<description summary="Update the width">
Indicates if width of the selected client.
</description>
<arg name="width" type="int" summary="width of the selected client"/>
</event>
<event name="height" since="2">
<description summary="Update the height">
Indicates if height of the selected client.
</description>
<arg name="height" type="int" summary="height of the selected client"/>
</event>
</interface>
</protocol>

View file

@ -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);
}