diff options
author | Timidger <APragmaticPlace@gmail.com> | 2018-04-17 20:11:24 -0400 |
---|---|---|
committer | Timidger <APragmaticPlace@gmail.com> | 2018-05-10 19:03:56 -0700 |
commit | 72847093706fc4ca7689870e07b6098dddc8afa3 (patch) | |
tree | 24ed5214cf1568c958e49962d97999c0e9303f8d /examples/simple.c | |
parent | 44b2bf18f0918bb44032daee0b42765d4bd2581f (diff) |
simple now works on DRM
Diffstat (limited to 'examples/simple.c')
-rw-r--r-- | examples/simple.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/simple.c b/examples/simple.c index 801dd9d7..506f582e 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -38,6 +38,7 @@ struct sample_keyboard { void output_frame_notify(struct wl_listener *listener, void *data) { + wlr_log(L_DEBUG, "Output removed"); struct sample_output *sample_output = wl_container_of(listener, sample_output, frame); struct sample_state *sample = sample_output->sample; struct timespec now; @@ -76,6 +77,10 @@ void new_output_notify(struct wl_listener *listener, void *data) { struct wlr_output *output = data; struct sample_state *sample = wl_container_of(listener, sample, new_output); struct sample_output *sample_output = calloc(1, sizeof(struct sample_output)); + if (wl_list_length(&output->modes) > 0) { + 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->sample = sample; wl_signal_add(&output->events.frame, &sample_output->frame); |