diff options
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | src/st.c | 20 |
2 files changed, 13 insertions, 9 deletions
@@ -20,7 +20,7 @@ SOURCES += $(wildcard $(WLDSRC)/nouveau/*.c) CFLAGS += -DWITH_NOUVEAU_DRM endif -CFLAGS += -std=c99 -Wall -g +CFLAGS += -std=c99 -Wall -g -DWITH_WAYLAND_DRM -DWITH_WAYLAND_SHM CFLAGS += $(shell pkg-config --cflags $(PKGS)) -I include LDFLAGS = $(shell pkg-config --libs $(PKGS)) -lm -lutil @@ -3202,14 +3202,16 @@ wlinit(void) registry = wl_display_get_registry(wl.dpy); wl_registry_add_listener(registry, ®listener, NULL); - wld.ctx = wld_wayland_create_context(wl.dpy, WLD_ANY); - if(!wld.ctx) - die("could not create wayland context"); - wld.renderer = wld_create_renderer(wld.ctx); - if(!wld.renderer) - die("could not create wayland rendering context"); - wl_display_roundtrip(wl.dpy); - + + wl_display_dispatch(wl.dpy); + wl_display_roundtrip(wl.dpy); + + wld.ctx = wld_wayland_create_context(wl.dpy, WLD_ANY); + if (!wld.ctx) + die("Can't create wayland context\n"); + wld.renderer = wld_create_renderer(wld.ctx); + if (!wld.ctx) + die("Can't create renderer\n"); if (!wl.shm) die("Display has no SHM\n"); if (!wl.seat) @@ -3217,6 +3219,8 @@ wlinit(void) if (!wl.datadevmanager) die("Display has no data device manager\n"); + wl_display_roundtrip(wl.dpy); + wl.keyboard = wl_seat_get_keyboard(wl.seat); wl_keyboard_add_listener(wl.keyboard, &kbdlistener, NULL); wl.pointer = wl_seat_get_pointer(wl.seat); |