diff --git a/src/screen.c b/src/screen.c index f62ed97..fb62bac 100644 --- a/src/screen.c +++ b/src/screen.c @@ -158,9 +158,19 @@ WScreen *wScreenInit(int screen_number) wm_backend->monitors_select_events(scr); wm_backend->screen_set_root_cursor(scr, WCUR_ROOT); - /* Wayland path: screen_open() sets geometry; X11/wrlib context not needed. */ - if (!dpy) + /* Wayland path: screen_open() sets geometry; X11/wrlib context not needed. + * Allocate workspace 0 directly (wWorkspaceNew is unsafe here because it + * calls wDockCreate which requires X11 rendering resources). */ + if (!dpy) { + WWorkspace *wspace = wmalloc(sizeof(WWorkspace)); + wspace->name = wstrdup("Workspace 1"); + wspace->clip = NULL; + wspace->map = NULL; + scr->workspaces = wmalloc(sizeof(WWorkspace *)); + scr->workspaces[0] = wspace; + scr->workspace_count = 1; goto screen_done; + } /* screen descriptor for raster graphic library */ rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_StandardColormap;