diff --git a/dri3/dri3_priv.h b/dri3/dri3_priv.h index 71d2da957..3486a309d 100644 --- a/dri3/dri3_priv.h +++ b/dri3/dri3_priv.h @@ -44,7 +44,6 @@ typedef struct dri3_dmabuf_format { typedef struct dri3_screen_priv { CloseScreenProcPtr CloseScreen; ConfigNotifyProcPtr ConfigNotify; - DestroyWindowProcPtr DestroyWindow; Bool formats_cached; CARD32 num_formats; diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 2f584a654..a80e1e00c 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -634,7 +634,7 @@ DRIScreenInit(ScreenPtr pScreen, DRIInfoPtr pDRIInfo, int *pDRMFD) return TRUE; } -static Bool DRIDestroyWindow(WindowPtr pWin); +static void DRIWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg); Bool DRIFinishScreenInit(ScreenPtr pScreen) @@ -648,8 +648,7 @@ DRIFinishScreenInit(ScreenPtr pScreen) pScreen->WindowExposures = pDRIInfo->wrap.WindowExposures; } - pDRIPriv->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = DRIDestroyWindow; + dixScreenHookWindowDestroy(pScreen, DRIWindowDestroy, NULL); pDRIPriv->xf86_crtc_notify = xf86_wrap_crtc_notify(pScreen, dri_crtc_notify); @@ -696,11 +695,8 @@ DRICloseScreen(ScreenPtr pScreen) pScreen->WindowExposures = pDRIPriv->wrap.WindowExposures; pDRIPriv->wrap.WindowExposures = NULL; } - if (pDRIPriv->DestroyWindow) { - pScreen->DestroyWindow = pDRIPriv->DestroyWindow; - pDRIPriv->DestroyWindow = NULL; - } + dixScreenUnhookWindowDestroy(pScreen, DRIWindowDestroy, NULL); xf86_unwrap_crtc_notify(pScreen, pDRIPriv->xf86_crtc_notify); if (pDRIInfo->wrap.CopyWindow) { @@ -1922,29 +1918,9 @@ DRITreeTraversal(WindowPtr pWin, void *data) return WT_WALKCHILDREN; } -static Bool -DRIDestroyWindow(WindowPtr pWin) +static void DRIWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg) { - ScreenPtr pScreen = pWin->drawable.pScreen; - DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen); - Bool retval = TRUE; - DRIDrawablePrivDestroy(pWin); - - /* call lower wrapped functions */ - if (pDRIPriv->DestroyWindow) { - /* unwrap */ - pScreen->DestroyWindow = pDRIPriv->DestroyWindow; - - /* call lower layers */ - retval = (*pScreen->DestroyWindow) (pWin); - - /* rewrap */ - pDRIPriv->DestroyWindow = pScreen->DestroyWindow; - pScreen->DestroyWindow = DRIDestroyWindow; - } - - return retval; } void diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h index 9f944a793..964a430af 100644 --- a/hw/xfree86/dri/dristruct.h +++ b/hw/xfree86/dri/dristruct.h @@ -90,7 +90,6 @@ typedef struct _DRIScreenPrivRec { DrawablePtr fullscreen; /* pointer to fullscreen drawable */ drm_clip_rect_t fullscreen_rect; /* fake rect for fullscreen mode */ DRIWrappedFuncsRec wrap; - DestroyWindowProcPtr DestroyWindow; DrawablePtr DRIDrawables[SAREA_MAX_DRAWABLES]; DRIContextPrivPtr dummyCtxPriv; /* Pointer to dummy context */ Bool createDummyCtx;