aboutsummaryrefslogtreecommitdiff
path: root/examples/output-layout.c
diff options
context:
space:
mode:
authorTimidger <APragmaticPlace@gmail.com>2018-05-10 19:03:36 -0700
committerTimidger <APragmaticPlace@gmail.com>2018-05-10 19:03:58 -0700
commit9a1d0e42d2c8eda68bba1c1b4dfecc4bf6485baa (patch)
tree4d9c53fab06869e67073a748844163f1fe06cfd6 /examples/output-layout.c
parent7da50d065b298b74e16c86065c19cfe22e157c6f (diff)
Fixed emersion's issues
Diffstat (limited to 'examples/output-layout.c')
-rw-r--r--examples/output-layout.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/examples/output-layout.c b/examples/output-layout.c
index 382e170e..d45100b6 100644
--- a/examples/output-layout.c
+++ b/examples/output-layout.c
@@ -160,8 +160,8 @@ 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);
+ 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);
}
wlr_output_layout_add_auto(sample->layout, output);
@@ -271,14 +271,6 @@ int main(int argc, char *argv[]) {
wl_signal_add(&wlr->events.new_input, &state.new_input);
state.new_input.notify = new_input_notify;
- const char *socket = wl_display_add_socket_auto(display);
- if (!socket) {
- wlr_log_errno(L_ERROR, "Unable to open wayland socket");
- wlr_backend_destroy(wlr);
- exit(1);
- }
- setenv("_WAYLAND_DISPLAY", socket, true);
-
state.renderer = wlr_backend_get_renderer(wlr);
state.cat_texture = wlr_texture_from_pixels(state.renderer,
WL_SHM_FORMAT_ABGR8888, cat_tex.width * 4, cat_tex.width, cat_tex.height,