aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile2
-rw-r--r--src/st.c20
2 files changed, 13 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 887c079..7e22906 100644
--- a/Makefile
+++ b/Makefile
@@ -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
diff --git a/src/st.c b/src/st.c
index abad585..0014d21 100644
--- a/src/st.c
+++ b/src/st.c
@@ -3202,14 +3202,16 @@ wlinit(void)
registry = wl_display_get_registry(wl.dpy);
wl_registry_add_listener(registry, &reglistener, 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);