diff options
author | Kristian Høgsberg <krh@bitplanet.net> | 2011-07-20 17:54:30 -0700 |
---|---|---|
committer | Kristian Høgsberg <krh@bitplanet.net> | 2012-03-27 09:31:59 -0400 |
commit | 913c309bf33a1e63f6969c62834e75a6611a9c73 (patch) | |
tree | f3f580c0d58632a7943b192ed269cd91cd9bbb08 | |
parent | c3de5dabd084cbace0a149539a355405181f960a (diff) |
xwayland: wait for output geometry before initializing output
-rw-r--r-- | hw/xfree86/xwayland/xwayland-output.c | 13 | ||||
-rw-r--r-- | hw/xfree86/xwayland/xwayland.c | 4 |
2 files changed, 11 insertions, 6 deletions
diff --git a/hw/xfree86/xwayland/xwayland-output.c b/hw/xfree86/xwayland/xwayland-output.c index 36b97078d..788ddf292 100644 --- a/hw/xfree86/xwayland/xwayland-output.c +++ b/hw/xfree86/xwayland/xwayland-output.c @@ -195,8 +195,6 @@ xwl_output_create(struct xwl_screen *xwl_screen) xwl_output->xf86output = xf86output; xwl_output->xf86crtc = xf86crtc; - xwl_screen->xwl_output = xwl_output; - return xwl_output; } @@ -224,6 +222,7 @@ display_handle_geometry(void *data, const char *model) { struct xwl_output *xwl_output = data; + struct xwl_screen *xwl_screen = xwl_output->xwl_screen; xwl_output->xf86output->mm_width = physical_width; xwl_output->xf86output->mm_height = physical_height; @@ -251,6 +250,8 @@ display_handle_geometry(void *data, xwl_output->x = x; xwl_output->y = y; + + xwl_screen->xwl_output = xwl_output; } static void @@ -301,9 +302,13 @@ xwayland_screen_preinit_output(struct xwl_screen *xwl_screen, ScrnInfoPtr scrnin xf86CrtcSetSizeRange(scrninfo, 320, 200, 8192, 8192); - xf86InitialConfiguration(scrninfo, TRUE); - xwl_screen->global_listener = wl_display_add_global_listener(xwl_screen->display, global_handler, xwl_screen); + + wl_display_flush(xwl_screen->display); + while (xwl_screen->xwl_output == NULL) + wl_display_iterate(xwl_screen->display, WL_DISPLAY_READABLE); + + xf86InitialConfiguration(scrninfo, TRUE); } diff --git a/hw/xfree86/xwayland/xwayland.c b/hw/xfree86/xwayland/xwayland.c index a7eecf120..cf50636c1 100644 --- a/hw/xfree86/xwayland/xwayland.c +++ b/hw/xfree86/xwayland/xwayland.c @@ -248,8 +248,6 @@ xwl_screen_pre_init(ScrnInfoPtr scrninfo, return NULL; } - xwayland_screen_preinit_output(xwl_screen, scrninfo); - /* Set up listener so we'll catch all events. */ xwl_screen->global_listener = wl_display_add_global_listener(xwl_screen->display, @@ -268,6 +266,8 @@ xwl_screen_pre_init(ScrnInfoPtr scrninfo, return NULL; #endif + xwayland_screen_preinit_output(xwl_screen, scrninfo); + if (!xwl_screen->premultiplied_argb_visual || !xwl_screen->rgb_visual) xwl_force_roundtrip(xwl_screen); if (!xwl_screen->premultiplied_argb_visual || !xwl_screen->rgb_visual) |