(!1714) kdrive: xv: 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
							
								
									c302f4bee4
								
							
						
					
					
						commit
						26ce5c0eaa
					
				|  | @ -82,9 +82,10 @@ static int KdXVPutImage(DrawablePtr, XvPortPtr, GCPtr, | ||||||
| static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr, | static int KdXVQueryImageAttributes(XvPortPtr, XvImagePtr, | ||||||
|                                     CARD16 *, CARD16 *, int *, int *); |                                     CARD16 *, CARD16 *, int *, int *); | ||||||
| 
 | 
 | ||||||
|  | static void KdXVWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg); | ||||||
|  | 
 | ||||||
| /* ScreenRec fields */ | /* ScreenRec fields */ | ||||||
| 
 | 
 | ||||||
| static Bool KdXVDestroyWindow(WindowPtr pWin); |  | ||||||
| static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1); | static void KdXVWindowExposures(WindowPtr pWin, RegionPtr r1); | ||||||
| static void KdXVClipNotify(WindowPtr pWin, int dx, int dy); | static void KdXVClipNotify(WindowPtr pWin, int dx, int dy); | ||||||
| static Bool KdXVCloseScreen(ScreenPtr); | static Bool KdXVCloseScreen(ScreenPtr); | ||||||
|  | @ -139,14 +140,14 @@ KdXVScreenInit(ScreenPtr pScreen, KdVideoAdaptorPtr adaptors, int num) | ||||||
|     if (!ScreenPriv) |     if (!ScreenPriv) | ||||||
|         return FALSE; |         return FALSE; | ||||||
| 
 | 
 | ||||||
|     ScreenPriv->DestroyWindow = pScreen->DestroyWindow; |     dixScreenHookWindowDestroy(pScreen, KdXVWindowDestroy, NULL); | ||||||
|  | 
 | ||||||
|     ScreenPriv->WindowExposures = pScreen->WindowExposures; |     ScreenPriv->WindowExposures = pScreen->WindowExposures; | ||||||
|     ScreenPriv->ClipNotify = pScreen->ClipNotify; |     ScreenPriv->ClipNotify = pScreen->ClipNotify; | ||||||
|     ScreenPriv->CloseScreen = pScreen->CloseScreen; |     ScreenPriv->CloseScreen = pScreen->CloseScreen; | ||||||
| 
 | 
 | ||||||
| /*   fprintf(stderr,"XV: Wrapping screen funcs\n"); */ | /*   fprintf(stderr,"XV: Wrapping screen funcs\n"); */ | ||||||
| 
 | 
 | ||||||
|     pScreen->DestroyWindow = KdXVDestroyWindow; |  | ||||||
|     pScreen->WindowExposures = KdXVWindowExposures; |     pScreen->WindowExposures = KdXVWindowExposures; | ||||||
|     pScreen->ClipNotify = KdXVClipNotify; |     pScreen->ClipNotify = KdXVClipNotify; | ||||||
|     pScreen->CloseScreen = KdXVCloseScreen; |     pScreen->CloseScreen = KdXVCloseScreen; | ||||||
|  | @ -755,13 +756,10 @@ KdXVRemovePortFromWindow(WindowPtr pWin, XvPortRecPrivatePtr portPriv) | ||||||
| 
 | 
 | ||||||
| /****  ScreenRec fields ****/ | /****  ScreenRec fields ****/ | ||||||
| 
 | 
 | ||||||
| static Bool | static void | ||||||
| KdXVDestroyWindow(WindowPtr pWin) | KdXVWindowDestroy(ScreenPtr pScreen, WindowPtr pWin, void *arg) | ||||||
| { | { | ||||||
|     ScreenPtr pScreen = pWin->drawable.pScreen; |  | ||||||
|     KdXVScreenPtr ScreenPriv = GET_KDXV_SCREEN(pScreen); |  | ||||||
|     KdXVWindowPtr tmp, WinPriv = GET_KDXV_WINDOW(pWin); |     KdXVWindowPtr tmp, WinPriv = GET_KDXV_WINDOW(pWin); | ||||||
|     int ret; |  | ||||||
| 
 | 
 | ||||||
|     while (WinPriv) { |     while (WinPriv) { | ||||||
|         XvPortRecPrivatePtr pPriv = WinPriv->PortRec; |         XvPortRecPrivatePtr pPriv = WinPriv->PortRec; | ||||||
|  | @ -779,12 +777,6 @@ KdXVDestroyWindow(WindowPtr pWin) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, NULL); |     dixSetPrivate(&pWin->devPrivates, KdXVWindowKey, NULL); | ||||||
| 
 |  | ||||||
|     pScreen->DestroyWindow = ScreenPriv->DestroyWindow; |  | ||||||
|     ret = (*pScreen->DestroyWindow) (pWin); |  | ||||||
|     pScreen->DestroyWindow = KdXVDestroyWindow; |  | ||||||
| 
 |  | ||||||
|     return ret; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static void | static void | ||||||
|  | @ -919,7 +911,6 @@ KdXVCloseScreen(ScreenPtr pScreen) | ||||||
|     if (!ScreenPriv) |     if (!ScreenPriv) | ||||||
|         return TRUE; |         return TRUE; | ||||||
| 
 | 
 | ||||||
|     pScreen->DestroyWindow = ScreenPriv->DestroyWindow; |  | ||||||
|     pScreen->WindowExposures = ScreenPriv->WindowExposures; |     pScreen->WindowExposures = ScreenPriv->WindowExposures; | ||||||
|     pScreen->ClipNotify = ScreenPriv->ClipNotify; |     pScreen->ClipNotify = ScreenPriv->ClipNotify; | ||||||
|     pScreen->CloseScreen = ScreenPriv->CloseScreen; |     pScreen->CloseScreen = ScreenPriv->CloseScreen; | ||||||
|  |  | ||||||
|  | @ -151,7 +151,6 @@ Bool | ||||||
| /*** These are DDX layer privates ***/ | /*** These are DDX layer privates ***/ | ||||||
| 
 | 
 | ||||||
| typedef struct { | typedef struct { | ||||||
|     DestroyWindowProcPtr DestroyWindow; |  | ||||||
|     ClipNotifyProcPtr ClipNotify; |     ClipNotifyProcPtr ClipNotify; | ||||||
|     WindowExposuresProcPtr WindowExposures; |     WindowExposuresProcPtr WindowExposures; | ||||||
|     CloseScreenProcPtr CloseScreen; |     CloseScreenProcPtr CloseScreen; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue