summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2023-07-19 09:38:19 +0200
committerOlivier Fourdan <ofourdan@redhat.com>2023-07-19 17:22:06 +0200
commit8ed4308e00298dc1edb08c2f4557c4c8db0bf1f9 (patch)
tree7b82c4e093075df42ae893ba64e9896978677922
parent04e33792cffdabad65514c74b47b0bf53556c8a3 (diff)
Revert "xwayland/glamor: Avoid implicit redirection with depth 32 parent windows"
This commit is meant as an optimization, but has been identified as the cause of multiple regressions reported in issues xorg/xserver#1564 and xorg/xserver#1565. Reverting that commit alone fixes the aforementioned issues, the rest of the commits from xorg/xserver!1131 seem harmless and do not need reverting. This reverts commit d6c5999e943e43e800f976a48e774fbef77f5ef2. See-also: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1564 See-also: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1565 (cherry picked from commit c4ee35ef24eb47d6465f86e064f237bdb833b10c)
-rw-r--r--hw/xwayland/xwayland-glamor.c109
-rw-r--r--hw/xwayland/xwayland-screen.h2
2 files changed, 0 insertions, 111 deletions
diff --git a/hw/xwayland/xwayland-glamor.c b/hw/xwayland/xwayland-glamor.c
index c6aa8eb17..9ac1aa8d4 100644
--- a/hw/xwayland/xwayland-glamor.c
+++ b/hw/xwayland/xwayland-glamor.c
@@ -25,8 +25,6 @@
#include <xwayland-config.h>
-#include <compositeext.h>
-
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <glamor_egl.h>
@@ -895,108 +893,6 @@ xwl_glamor_allow_commits(struct xwl_window *xwl_window)
return TRUE;
}
-static void
-xwl_avoid_implicit_redirect(WindowPtr window)
-{
- ScreenPtr screen = window->drawable.pScreen;
- WindowOptPtr parent_optional;
- VisualPtr parent_visual = NULL;
- VisualPtr window_visual = NULL;
- DepthPtr depth32 = NULL;
- int i;
-
- if (!window->optional)
- return;
-
- parent_optional = FindWindowWithOptional(window)->optional;
- if (window->optional == parent_optional ||
- window->optional->visual == parent_optional->visual ||
- CompositeIsImplicitRedirectException(screen, parent_optional->visual,
- window->optional->visual))
- return;
-
- for (i = 0; i < screen->numDepths; i++) {
- if (screen->allowedDepths[i].depth == 32) {
- depth32 = &screen->allowedDepths[i];
- break;
- }
- }
-
- if (!depth32)
- return;
-
- for (i = 0; i < depth32->numVids; i++) {
- XID argb_vid = depth32->vids[i];
-
- if (argb_vid != parent_optional->visual)
- continue;
-
- if (!compIsAlternateVisual(screen, argb_vid))
- break;
-
- for (i = 0; i < screen->numVisuals; i++) {
- if (screen->visuals[i].vid == argb_vid) {
- parent_visual = &screen->visuals[i];
- break;
- }
- }
- }
-
- if (!parent_visual)
- return;
-
- for (i = 0; i < screen->numVisuals; i++) {
- if (screen->visuals[i].vid == window->optional->visual) {
- window_visual = &screen->visuals[i];
- break;
- }
- }
-
- if ((window_visual->class != TrueColor &&
- window_visual->class != DirectColor) ||
- window_visual->redMask != parent_visual->redMask ||
- window_visual->greenMask != parent_visual->greenMask ||
- window_visual->blueMask != parent_visual->blueMask ||
- window_visual->offsetRed != parent_visual->offsetRed ||
- window_visual->offsetGreen != parent_visual->offsetGreen ||
- window_visual->offsetBlue != parent_visual->offsetBlue)
- return;
-
- CompositeRegisterImplicitRedirectionException(screen, parent_visual->vid, window_visual->vid);
-}
-
-static Bool
-xwl_glamor_create_window(WindowPtr window)
-{
- ScreenPtr screen = window->drawable.pScreen;
- struct xwl_screen *xwl_screen = xwl_screen_get(screen);
- Bool ret;
-
- if (window->parent)
- xwl_avoid_implicit_redirect(window);
-
- screen->CreateWindow = xwl_screen->CreateWindow;
- ret = (*screen->CreateWindow) (window);
- xwl_screen->CreateWindow = screen->CreateWindow;
- screen->CreateWindow = xwl_glamor_create_window;
-
- return ret;
-}
-
-static void
-xwl_glamor_reparent_window(WindowPtr window, WindowPtr old_parent)
-{
- ScreenPtr screen = window->drawable.pScreen;
- struct xwl_screen *xwl_screen = xwl_screen_get(screen);
-
- xwl_avoid_implicit_redirect(window);
-
- screen->ReparentWindow = xwl_screen->ReparentWindow;
- (*screen->ReparentWindow) (window, old_parent);
- xwl_screen->ReparentWindow = screen->ReparentWindow;
- screen->ReparentWindow = xwl_glamor_reparent_window;
-}
-
static Bool
xwl_glamor_create_screen_resources(ScreenPtr screen)
{
@@ -1011,11 +907,6 @@ xwl_glamor_create_screen_resources(ScreenPtr screen)
if (!ret)
return ret;
- xwl_screen->CreateWindow = screen->CreateWindow;
- screen->CreateWindow = xwl_glamor_create_window;
- xwl_screen->ReparentWindow = screen->ReparentWindow;
- screen->ReparentWindow = xwl_glamor_reparent_window;
-
if (xwl_screen->rootless) {
screen->devPrivate =
fbCreatePixmap(screen, 0, 0, screen->rootDepth, 0);
diff --git a/hw/xwayland/xwayland-screen.h b/hw/xwayland/xwayland-screen.h
index 94033aabf..da97d7f1d 100644
--- a/hw/xwayland/xwayland-screen.h
+++ b/hw/xwayland/xwayland-screen.h
@@ -70,14 +70,12 @@ struct xwl_screen {
CreateScreenResourcesProcPtr CreateScreenResources;
CloseScreenProcPtr CloseScreen;
- CreateWindowProcPtr CreateWindow;
RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow;
DestroyWindowProcPtr DestroyWindow;
XYToWindowProcPtr XYToWindow;
SetWindowPixmapProcPtr SetWindowPixmap;
ChangeWindowAttributesProcPtr ChangeWindowAttributes;
- ReparentWindowProcPtr ReparentWindow;
ResizeWindowProcPtr ResizeWindow;
MoveWindowProcPtr MoveWindow;