mirror of
https://github.com/hyprwm/wlroots-hyprland.git
synced 2024-11-22 21:05:58 +01:00
scene/output-layout: add initial outputs
This commit is contained in:
parent
0c2eed533e
commit
1284f85da4
1 changed files with 16 additions and 6 deletions
|
@ -72,12 +72,8 @@ static void scene_output_layout_handle_layout_change(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void scene_output_layout_handle_layout_add(
|
static void scene_output_layout_add(struct wlr_scene_output_layout *sol,
|
||||||
struct wl_listener *listener, void *data) {
|
struct wlr_output_layout_output *lo) {
|
||||||
struct wlr_scene_output_layout *sol =
|
|
||||||
wl_container_of(listener, sol, layout_add);
|
|
||||||
struct wlr_output_layout_output *lo = data;
|
|
||||||
|
|
||||||
struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo));
|
struct wlr_scene_output_layout_output *solo = calloc(1, sizeof(*solo));
|
||||||
if (solo == NULL) {
|
if (solo == NULL) {
|
||||||
return;
|
return;
|
||||||
|
@ -105,6 +101,15 @@ static void scene_output_layout_handle_layout_add(
|
||||||
wlr_scene_output_set_position(solo->scene_output, lo->x, lo->y);
|
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(
|
static void scene_output_layout_handle_layout_destroy(
|
||||||
struct wl_listener *listener, void *data) {
|
struct wl_listener *listener, void *data) {
|
||||||
struct wlr_scene_output_layout *sol =
|
struct wlr_scene_output_layout *sol =
|
||||||
|
@ -143,5 +148,10 @@ bool wlr_scene_attach_output_layout(struct wlr_scene *scene,
|
||||||
sol->scene_destroy.notify = scene_output_layout_handle_scene_destroy;
|
sol->scene_destroy.notify = scene_output_layout_handle_scene_destroy;
|
||||||
wl_signal_add(&scene->tree.node.events.destroy, &sol->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 true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue