composite: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new window destructor hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									3319de0d2b
								
							
						
					
					
						commit
						aecb404ffc
					
				| 
						 | 
				
			
			@ -76,12 +76,13 @@ compCloseScreen(ScreenPtr pScreen)
 | 
			
		|||
    pScreen->ClipNotify = cs->ClipNotify;
 | 
			
		||||
    pScreen->UnrealizeWindow = cs->UnrealizeWindow;
 | 
			
		||||
    pScreen->RealizeWindow = cs->RealizeWindow;
 | 
			
		||||
    pScreen->DestroyWindow = cs->DestroyWindow;
 | 
			
		||||
    pScreen->CreateWindow = cs->CreateWindow;
 | 
			
		||||
    pScreen->CopyWindow = cs->CopyWindow;
 | 
			
		||||
    pScreen->PositionWindow = cs->PositionWindow;
 | 
			
		||||
    pScreen->SourceValidate = cs->SourceValidate;
 | 
			
		||||
 | 
			
		||||
    dixScreenUnhookWindowDestroy(pScreen, compWindowDestroy);
 | 
			
		||||
 | 
			
		||||
    free(cs);
 | 
			
		||||
    dixSetPrivate(&pScreen->devPrivates, CompScreenPrivateKey, NULL);
 | 
			
		||||
    ret = (*pScreen->CloseScreen) (pScreen);
 | 
			
		||||
| 
						 | 
				
			
			@ -368,6 +369,8 @@ compScreenInit(ScreenPtr pScreen)
 | 
			
		|||
    if (!disableBackingStore)
 | 
			
		||||
        pScreen->backingStoreSupport = WhenMapped;
 | 
			
		||||
 | 
			
		||||
    dixScreenHookWindowDestroy(pScreen, compWindowDestroy);
 | 
			
		||||
 | 
			
		||||
    cs->PositionWindow = pScreen->PositionWindow;
 | 
			
		||||
    pScreen->PositionWindow = compPositionWindow;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -377,9 +380,6 @@ compScreenInit(ScreenPtr pScreen)
 | 
			
		|||
    cs->CreateWindow = pScreen->CreateWindow;
 | 
			
		||||
    pScreen->CreateWindow = compCreateWindow;
 | 
			
		||||
 | 
			
		||||
    cs->DestroyWindow = pScreen->DestroyWindow;
 | 
			
		||||
    pScreen->DestroyWindow = compDestroyWindow;
 | 
			
		||||
 | 
			
		||||
    cs->RealizeWindow = pScreen->RealizeWindow;
 | 
			
		||||
    pScreen->RealizeWindow = compRealizeWindow;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -128,7 +128,6 @@ typedef struct _CompScreen {
 | 
			
		|||
    PositionWindowProcPtr PositionWindow;
 | 
			
		||||
    CopyWindowProcPtr CopyWindow;
 | 
			
		||||
    CreateWindowProcPtr CreateWindow;
 | 
			
		||||
    DestroyWindowProcPtr DestroyWindow;
 | 
			
		||||
    RealizeWindowProcPtr RealizeWindow;
 | 
			
		||||
    UnrealizeWindowProcPtr UnrealizeWindow;
 | 
			
		||||
    ClipNotifyProcPtr ClipNotify;
 | 
			
		||||
| 
						 | 
				
			
			@ -309,8 +308,7 @@ void
 | 
			
		|||
Bool
 | 
			
		||||
 compCreateWindow(WindowPtr pWin);
 | 
			
		||||
 | 
			
		||||
Bool
 | 
			
		||||
 compDestroyWindow(WindowPtr pWin);
 | 
			
		||||
void compWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin);
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
 compSetRedirectBorderClip(WindowPtr pWin, RegionPtr pRegion);
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -596,16 +596,12 @@ compCreateWindow(WindowPtr pWin)
 | 
			
		|||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
Bool
 | 
			
		||||
compDestroyWindow(WindowPtr pWin)
 | 
			
		||||
void compWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin)
 | 
			
		||||
{
 | 
			
		||||
    ScreenPtr pScreen = pWin->drawable.pScreen;
 | 
			
		||||
    CompScreenPtr cs = GetCompScreen(pScreen);
 | 
			
		||||
    CompWindowPtr cw;
 | 
			
		||||
    CompSubwindowsPtr csw;
 | 
			
		||||
    Bool ret;
 | 
			
		||||
 | 
			
		||||
    pScreen->DestroyWindow = cs->DestroyWindow;
 | 
			
		||||
    while ((cw = GetCompWindow(pWin)))
 | 
			
		||||
        FreeResource(cw->clients->id, X11_RESTYPE_NONE);
 | 
			
		||||
    while ((csw = GetCompSubwindows(pWin)))
 | 
			
		||||
| 
						 | 
				
			
			@ -617,16 +613,12 @@ compDestroyWindow(WindowPtr pWin)
 | 
			
		|||
        compSetParentPixmap(pWin);
 | 
			
		||||
        dixDestroyPixmap(pPixmap, 0);
 | 
			
		||||
    }
 | 
			
		||||
    ret = (*pScreen->DestroyWindow) (pWin);
 | 
			
		||||
    cs->DestroyWindow = pScreen->DestroyWindow;
 | 
			
		||||
    pScreen->DestroyWindow = compDestroyWindow;
 | 
			
		||||
 | 
			
		||||
    /* Did we just destroy the overlay window? */
 | 
			
		||||
    if (pWin == cs->pOverlayWin)
 | 
			
		||||
        cs->pOverlayWin = NULL;
 | 
			
		||||
 | 
			
		||||
/*    compCheckTree (pWin->drawable.pScreen); can't check -- tree isn't good*/
 | 
			
		||||
    return ret;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue