mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-22 06:59:44 -05:00
decouples outputenable state and wl_output global
This decouples wlr_output_enable and the wl_global. The previously internal functions wlr_output_(destroy/create)_global are exposed and used automatically in the wlr_output_layout to create/tear down the global. The compositor can handle them itself if it wants to, but I think this is the right moment to create/destroy the wl_output when the wlr_output_layout is used.
This commit is contained in:
parent
03440bbd83
commit
3cf7225cec
8 changed files with 14 additions and 25 deletions
|
|
@ -113,7 +113,7 @@ static void wl_output_bind(struct wl_client *wl_client, void *data,
|
|||
wl_output_send_to_resource(wl_resource);
|
||||
}
|
||||
|
||||
static void wlr_output_create_global(struct wlr_output *output) {
|
||||
void wlr_output_create_global(struct wlr_output *output) {
|
||||
if (output->wl_global != NULL) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -122,7 +122,7 @@ static void wlr_output_create_global(struct wlr_output *output) {
|
|||
output->wl_global = wl_global;
|
||||
}
|
||||
|
||||
static void wlr_output_destroy_global(struct wlr_output *output) {
|
||||
void wlr_output_destroy_global(struct wlr_output *output) {
|
||||
if (output->wl_global == NULL) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -134,22 +134,6 @@ static void wlr_output_destroy_global(struct wlr_output *output) {
|
|||
output->wl_global = NULL;
|
||||
}
|
||||
|
||||
void wlr_output_update_enabled(struct wlr_output *output, bool enabled) {
|
||||
if (output->enabled == enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
output->enabled = enabled;
|
||||
|
||||
if (enabled) {
|
||||
wlr_output_create_global(output);
|
||||
} else {
|
||||
wlr_output_destroy_global(output);
|
||||
}
|
||||
|
||||
wl_signal_emit(&output->events.enable, output);
|
||||
}
|
||||
|
||||
static void wlr_output_update_matrix(struct wlr_output *output) {
|
||||
wlr_matrix_texture(output->transform_matrix, output->width, output->height,
|
||||
output->transform);
|
||||
|
|
|
|||
|
|
@ -203,6 +203,7 @@ void wlr_output_layout_add(struct wlr_output_layout *layout,
|
|||
l_output->y = y;
|
||||
l_output->state->auto_configured = false;
|
||||
wlr_output_layout_reconfigure(layout);
|
||||
wlr_output_create_global(output);
|
||||
wl_signal_emit(&layout->events.add, l_output);
|
||||
}
|
||||
|
||||
|
|
@ -289,6 +290,7 @@ void wlr_output_layout_remove(struct wlr_output_layout *layout,
|
|||
wlr_output_layout_output_destroy(l_output);
|
||||
wlr_output_layout_reconfigure(layout);
|
||||
}
|
||||
wlr_output_destroy_global(output);
|
||||
}
|
||||
|
||||
void wlr_output_layout_output_coords(struct wlr_output_layout *layout,
|
||||
|
|
@ -394,6 +396,7 @@ void wlr_output_layout_add_auto(struct wlr_output_layout *layout,
|
|||
|
||||
l_output->state->auto_configured = true;
|
||||
wlr_output_layout_reconfigure(layout);
|
||||
wlr_output_create_global(output);
|
||||
wl_signal_emit(&layout->events.add, l_output);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue