|
|
|
@ -8,7 +8,6 @@ struct wlr_scene_output_layout {
|
|
|
|
|
|
|
|
|
|
struct wl_list outputs; // wlr_scene_output_layout_output.link
|
|
|
|
|
|
|
|
|
|
struct wl_listener layout_add;
|
|
|
|
|
struct wl_listener layout_change;
|
|
|
|
|
struct wl_listener layout_destroy;
|
|
|
|
|
struct wl_listener scene_destroy;
|
|
|
|
@ -53,7 +52,6 @@ static void scene_output_layout_destroy(struct wlr_scene_output_layout *sol) {
|
|
|
|
|
wl_list_for_each_safe(solo, tmp, &sol->outputs, link) {
|
|
|
|
|
scene_output_layout_output_destroy(solo);
|
|
|
|
|
}
|
|
|
|
|
wl_list_remove(&sol->layout_add.link);
|
|
|
|
|
wl_list_remove(&sol->layout_change.link);
|
|
|
|
|
wl_list_remove(&sol->layout_destroy.link);
|
|
|
|
|
wl_list_remove(&sol->scene_destroy.link);
|
|
|
|
@ -72,19 +70,14 @@ static void scene_output_layout_handle_layout_change(
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void scene_output_layout_add(struct wlr_scene_output_layout *sol,
|
|
|
|
|
struct wlr_output_layout_output *lo) {
|
|
|
|
|
void wlr_scene_output_layout_add_output(struct wlr_scene_output_layout *sol,
|
|
|
|
|
struct wlr_output_layout_output *lo, struct wlr_scene_output *so) {
|
|
|
|
|
struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo));
|
|
|
|
|
if (solo == NULL) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
solo->scene_output = wlr_scene_output_create(sol->scene, lo->output);
|
|
|
|
|
if (solo->scene_output == NULL) {
|
|
|
|
|
free(solo);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
solo->scene_output = so;
|
|
|
|
|
solo->layout_output = lo;
|
|
|
|
|
|
|
|
|
|
solo->layout_output_destroy.notify =
|
|
|
|
@ -101,15 +94,6 @@ static void scene_output_layout_add(struct wlr_scene_output_layout *sol,
|
|
|
|
|
wlr_scene_output_set_position(solo->scene_output, lo->x, lo->y);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void scene_output_layout_handle_layout_add(
|
|
|
|
|
struct wl_listener *listener, void *data) {
|
|
|
|
|
struct wlr_scene_output_layout *sol =
|
|
|
|
|
wl_container_of(listener, sol, layout_add);
|
|
|
|
|
struct wlr_output_layout_output *lo = data;
|
|
|
|
|
|
|
|
|
|
scene_output_layout_add(sol, lo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void scene_output_layout_handle_layout_destroy(
|
|
|
|
|
struct wl_listener *listener, void *data) {
|
|
|
|
|
struct wlr_scene_output_layout *sol =
|
|
|
|
@ -124,11 +108,11 @@ static void scene_output_layout_handle_scene_destroy(
|
|
|
|
|
scene_output_layout_destroy(sol);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
bool wlr_scene_attach_output_layout(struct wlr_scene *scene,
|
|
|
|
|
struct wlr_scene_output_layout *wlr_scene_attach_output_layout(struct wlr_scene *scene,
|
|
|
|
|
struct wlr_output_layout *output_layout) {
|
|
|
|
|
struct wlr_scene_output_layout *sol = calloc(1, sizeof(*sol));
|
|
|
|
|
if (sol == NULL) {
|
|
|
|
|
return false;
|
|
|
|
|
return NULL;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sol->scene = scene;
|
|
|
|
@ -142,16 +126,8 @@ bool wlr_scene_attach_output_layout(struct wlr_scene *scene,
|
|
|
|
|
sol->layout_change.notify = scene_output_layout_handle_layout_change;
|
|
|
|
|
wl_signal_add(&output_layout->events.change, &sol->layout_change);
|
|
|
|
|
|
|
|
|
|
sol->layout_add.notify = scene_output_layout_handle_layout_add;
|
|
|
|
|
wl_signal_add(&output_layout->events.add, &sol->layout_add);
|
|
|
|
|
|
|
|
|
|
sol->scene_destroy.notify = scene_output_layout_handle_scene_destroy;
|
|
|
|
|
wl_signal_add(&scene->tree.node.events.destroy, &sol->scene_destroy);
|
|
|
|
|
|
|
|
|
|
struct wlr_output_layout_output *lo;
|
|
|
|
|
wl_list_for_each(lo, &output_layout->outputs, link) {
|
|
|
|
|
scene_output_layout_add(sol, lo);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
return sol;
|
|
|
|
|
}
|
|
|
|
|