diff options
| author | Max Verevkin <34583604+MaxVerevkin@users.noreply.github.com> | 2023-02-03 21:48:08 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-02-03 19:48:08 +0000 |
| commit | 3e6601fa2989d750135d218c1fea3a13ddeae5c3 (patch) | |
| tree | e80592b9d9d175de8bfe1008551c4c2ca90c8931 /src/wlrunstable/wlr_ext_workspace_v1.cpp | |
| parent | a0bc0e4998f464656e74cbc683986204189ebefb (diff) | |
ext_workspace_unstable: send output_enter when wl_output is bound late (#1480)
Diffstat (limited to 'src/wlrunstable/wlr_ext_workspace_v1.cpp')
| -rw-r--r-- | src/wlrunstable/wlr_ext_workspace_v1.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/wlrunstable/wlr_ext_workspace_v1.cpp b/src/wlrunstable/wlr_ext_workspace_v1.cpp index f3020cd6..bd91916f 100644 --- a/src/wlrunstable/wlr_ext_workspace_v1.cpp +++ b/src/wlrunstable/wlr_ext_workspace_v1.cpp @@ -405,6 +405,22 @@ static void group_send_output(struct wlr_ext_workspace_group_handle_v1 *group, } } +static void workspace_handle_output_bind(struct wl_listener *listener, + void *data) { + struct wlr_output_event_bind *evt = (wlr_output_event_bind *)data; + struct wlr_ext_workspace_group_handle_v1_output *output = + wl_container_of(listener, output, output_bind); + struct wl_client *client = wl_resource_get_client(evt->resource); + + struct wl_resource *group_resource, *tmp; + wl_resource_for_each_safe(group_resource, tmp, &output->group_handle->resources) { + if (client == wl_resource_get_client(group_resource)) { + zext_workspace_group_handle_v1_send_output_enter(group_resource, + evt->resource); + } + } +} + static void workspace_handle_output_destroy(struct wl_listener *listener, void *data) { struct wlr_ext_workspace_group_handle_v1_output *output = @@ -432,6 +448,9 @@ void wlr_ext_workspace_group_handle_v1_output_enter( group_output->group_handle = group; wl_list_insert(&group->outputs, &group_output->link); + group_output->output_bind.notify = workspace_handle_output_bind; + wl_signal_add(&output->events.bind, &group_output->output_bind); + group_output->output_destroy.notify = workspace_handle_output_destroy; wl_signal_add(&output->events.destroy, &group_output->output_destroy); |
