summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/wlshm.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/wlshm.c b/src/wlshm.c
index 8f5cf8a..91c8099 100644
--- a/src/wlshm.c
+++ b/src/wlshm.c
@@ -601,16 +601,17 @@ wlshm_pre_init(ScrnInfoPtr pScrn, int flags)
xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, wlshm->options);
- if (xf86LoadSubModule(pScrn, "xwayland") == NULL) {
- goto error;
- }
-
- wlshm->xwl_screen = xwl_screen_pre_init(pScrn, 0, &xwl_driver);
+ wlshm->xwl_screen = xwl_screen_create();
if (!wlshm->xwl_screen) {
xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to initialize xwayland.\n");
goto error;
}
+ if (!xwl_screen_pre_init(pScrn, wlshm->xwl_screen, 0, &xwl_driver)) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Failed to pre-init xwayland screen\n");
+ xwl_screen_destroy(wlshm->xwl_screen);
+ }
+
/* Subtract memory for HW cursor */
xf86ValidateModesSize(pScrn, pScrn->monitor->Modes,
pScrn->display->virtualX,