|
|
@ -145,10 +145,6 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
|
|
|
struct wlr_output *output = data;
|
|
|
|
struct wlr_output *output = data;
|
|
|
|
struct sample_state *sample = wl_container_of(listener, sample, new_output);
|
|
|
|
struct sample_state *sample = wl_container_of(listener, sample, new_output);
|
|
|
|
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
|
|
|
struct sample_output *sample_output = calloc(1, sizeof(struct sample_output));
|
|
|
|
if (!wl_list_empty(&output->modes)) {
|
|
|
|
|
|
|
|
struct wlr_output_mode *mode = wl_container_of(output->modes.prev, mode, link);
|
|
|
|
|
|
|
|
wlr_output_set_mode(output, mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
sample_output->output = output;
|
|
|
|
sample_output->output = output;
|
|
|
|
sample_output->sample = sample;
|
|
|
|
sample_output->sample = sample;
|
|
|
|
wl_signal_add(&output->events.frame, &sample_output->frame);
|
|
|
|
wl_signal_add(&output->events.frame, &sample_output->frame);
|
|
|
@ -158,7 +154,6 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
|
|
|
|
|
|
|
|
|
|
|
wlr_output_layout_add_auto(sample->layout, output);
|
|
|
|
wlr_output_layout_add_auto(sample->layout, output);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct sample_cursor *cursor;
|
|
|
|
struct sample_cursor *cursor;
|
|
|
|
wl_list_for_each(cursor, &sample->cursors, link) {
|
|
|
|
wl_list_for_each(cursor, &sample->cursors, link) {
|
|
|
|
configure_cursor(cursor->cursor, cursor->device, sample);
|
|
|
|
configure_cursor(cursor->cursor, cursor->device, sample);
|
|
|
@ -172,6 +167,11 @@ static void new_output_notify(struct wl_listener *listener, void *data) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
wl_list_insert(&sample->outputs, &sample_output->link);
|
|
|
|
wl_list_insert(&sample->outputs, &sample_output->link);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
struct wlr_output_mode *mode = wlr_output_preferred_mode(output);
|
|
|
|
|
|
|
|
if (mode != NULL) {
|
|
|
|
|
|
|
|
wlr_output_set_mode(output, mode);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
wlr_output_commit(output);
|
|
|
|
wlr_output_commit(output);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|