mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-22 20:25:59 +01:00
ext_workspace_unstable: send output_enter when wl_output is bound late (#1480)
This commit is contained in:
parent
a0bc0e4998
commit
3e6601fa29
2 changed files with 20 additions and 0 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@ struct wlr_ext_workspace_group_handle_v1_create_workspace_event {
|
|||
|
||||
struct wlr_ext_workspace_group_handle_v1_output {
|
||||
struct wl_list link; // wlr_ext_workspace_group_handle_v1::outputs
|
||||
struct wl_listener output_bind;
|
||||
struct wl_listener output_destroy;
|
||||
struct wlr_output *output;
|
||||
|
||||
|
|
Loading…
Reference in a new issue