Revert "xwayland/glamor: Avoid implicit redirection with depth 32 parent windows"

There are a number of regressions and hard to reproduce issues that find
their roots in this change, so revert it until those can be ironed out
some more.

This reverts commit 4bb1f976d5.

Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1655
Closes: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1656
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1457>
This commit is contained in:
Olivier Fourdan 2024-04-03 14:35:02 +02:00 committed by Marge Bot
parent f0748b05dc
commit a65bb8480a
2 changed files with 0 additions and 112 deletions

View File

@ -25,9 +25,6 @@
#include <xwayland-config.h> #include <xwayland-config.h>
#include <compositeext.h>
#include "compositeext_priv.h"
#define MESA_EGL_NO_X11_HEADERS #define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11 #define EGL_NO_X11
#include <glamor_egl.h> #include <glamor_egl.h>
@ -133,108 +130,6 @@ xwl_glamor_has_wl_interfaces(struct xwl_screen *xwl_screen)
return TRUE; 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 static Bool
xwl_glamor_create_screen_resources(ScreenPtr screen) xwl_glamor_create_screen_resources(ScreenPtr screen)
{ {
@ -249,11 +144,6 @@ xwl_glamor_create_screen_resources(ScreenPtr screen)
if (!ret) if (!ret)
return 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) { if (xwl_screen->rootless) {
screen->devPrivate = screen->devPrivate =
fbCreatePixmap(screen, 0, 0, screen->rootDepth, 0); fbCreatePixmap(screen, 0, 0, screen->rootDepth, 0);

View File

@ -72,14 +72,12 @@ struct xwl_screen {
CreateScreenResourcesProcPtr CreateScreenResources; CreateScreenResourcesProcPtr CreateScreenResources;
CloseScreenProcPtr CloseScreen; CloseScreenProcPtr CloseScreen;
ConfigNotifyProcPtr ConfigNotify; ConfigNotifyProcPtr ConfigNotify;
CreateWindowProcPtr CreateWindow;
RealizeWindowProcPtr RealizeWindow; RealizeWindowProcPtr RealizeWindow;
UnrealizeWindowProcPtr UnrealizeWindow; UnrealizeWindowProcPtr UnrealizeWindow;
DestroyWindowProcPtr DestroyWindow; DestroyWindowProcPtr DestroyWindow;
XYToWindowProcPtr XYToWindow; XYToWindowProcPtr XYToWindow;
SetWindowPixmapProcPtr SetWindowPixmap; SetWindowPixmapProcPtr SetWindowPixmap;
ChangeWindowAttributesProcPtr ChangeWindowAttributes; ChangeWindowAttributesProcPtr ChangeWindowAttributes;
ReparentWindowProcPtr ReparentWindow;
MoveWindowProcPtr MoveWindow; MoveWindowProcPtr MoveWindow;
SourceValidateProcPtr SourceValidate; SourceValidateProcPtr SourceValidate;