diff --git a/hw/kdrive/ephyr/ephyr.c b/hw/kdrive/ephyr/ephyr.c index 2bc5ccc58..e5f188334 100644 --- a/hw/kdrive/ephyr/ephyr.c +++ b/hw/kdrive/ephyr/ephyr.c @@ -510,6 +510,14 @@ ephyrRandRSetConfig(ScreenPtr pScreen, screen->width = newwidth; screen->height = newheight; + scrpriv->win_width = screen->width; + scrpriv->win_height = screen->height; +#ifdef GLAMOR + ephyr_glamor_set_window_size(scrpriv->glamor, + scrpriv->win_width, + scrpriv->win_height); +#endif + if (!ephyrMapFramebuffer(screen)) goto bail4; @@ -520,12 +528,18 @@ ephyrRandRSetConfig(ScreenPtr pScreen, else ephyrUnsetInternalDamage(screen->pScreen); + ephyrSetScreenSizes(screen->pScreen); + if (scrpriv->shadow) { if (!KdShadowSet(screen->pScreen, scrpriv->randr, ephyrShadowUpdate, ephyrWindowLinear)) goto bail4; } else { +#ifdef GLAMOR + if (ephyr_glamor) + ephyr_glamor_create_screen_resources(pScreen); +#endif /* Without shadow fb ( non rotated ) we need * to use damage to efficiently update display * via signal regions what to copy from 'fb'. @@ -534,8 +548,6 @@ ephyrRandRSetConfig(ScreenPtr pScreen, goto bail4; } - ephyrSetScreenSizes(screen->pScreen); - /* * Set frame buffer mapping */ diff --git a/hw/kdrive/ephyr/hostx.c b/hw/kdrive/ephyr/hostx.c index d84c33b2a..abe6edaf0 100644 --- a/hw/kdrive/ephyr/hostx.c +++ b/hw/kdrive/ephyr/hostx.c @@ -1486,13 +1486,25 @@ ephyr_glamor_init(ScreenPtr screen) return TRUE; } +static int +ephyrSetPixmapVisitWindow(WindowPtr window, void *data) +{ + ScreenPtr screen = window->drawable.pScreen; + + if (screen->GetWindowPixmap(window) == data) { + screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen)); + return WT_WALKCHILDREN; + } + return WT_DONTWALKCHILDREN; +} + Bool ephyr_glamor_create_screen_resources(ScreenPtr pScreen) { KdScreenPriv(pScreen); KdScreenInfo *kd_screen = pScreenPriv->screen; EphyrScrPriv *scrpriv = kd_screen->driver; - PixmapPtr screen_pixmap; + PixmapPtr old_screen_pixmap, screen_pixmap; uint32_t tex; if (!ephyr_glamor) @@ -1509,8 +1521,8 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen) * * Thus, delete the current screen pixmap, and put a fresh one in. */ - screen_pixmap = pScreen->GetScreenPixmap(pScreen); - pScreen->DestroyPixmap(screen_pixmap); + old_screen_pixmap = pScreen->GetScreenPixmap(pScreen); + pScreen->DestroyPixmap(old_screen_pixmap); screen_pixmap = pScreen->CreatePixmap(pScreen, pScreen->width, @@ -1519,6 +1531,8 @@ ephyr_glamor_create_screen_resources(ScreenPtr pScreen) GLAMOR_CREATE_NO_LARGE); pScreen->SetScreenPixmap(screen_pixmap); + if (pScreen->root && pScreen->SetWindowPixmap) + TraverseTree(pScreen->root, ephyrSetPixmapVisitWindow, old_screen_pixmap); /* Tell the GLX code what to GL texture to read from. */ tex = glamor_get_pixmap_texture(screen_pixmap);