(!1714) render: use CloseScreen hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new screen close notify hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									c9680408a2
								
							
						
					
					
						commit
						2070c4b596
					
				|  | @ -60,7 +60,6 @@ typedef struct _AnimCur { | |||
| } AnimCurRec, *AnimCurPtr; | ||||
| 
 | ||||
| typedef struct _AnimScrPriv { | ||||
|     CloseScreenProcPtr CloseScreen; | ||||
|     CursorLimitsProcPtr CursorLimits; | ||||
|     DisplayCursorProcPtr DisplayCursor; | ||||
|     SetCursorPositionProcPtr SetCursorPosition; | ||||
|  | @ -84,13 +83,11 @@ static DevPrivateKeyRec AnimCurScreenPrivateKeyRec; | |||
| #define Wrap(as,s,elt,func) (((as)->elt = (s)->elt), (s)->elt = func) | ||||
| #define Unwrap(as,s,elt)    ((s)->elt = (as)->elt) | ||||
| 
 | ||||
| static Bool | ||||
| AnimCurCloseScreen(ScreenPtr pScreen) | ||||
| static void AnimCurScreenClose(ScreenPtr pScreen, void *arg) | ||||
| { | ||||
|     AnimCurScreenPtr as = GetAnimCurScreen(pScreen); | ||||
|     Bool ret; | ||||
| 
 | ||||
|     Unwrap(as, pScreen, CloseScreen); | ||||
|     dixScreenUnhookClose(pScreen, AnimCurScreenClose, NULL); | ||||
| 
 | ||||
|     Unwrap(as, pScreen, CursorLimits); | ||||
|     Unwrap(as, pScreen, DisplayCursor); | ||||
|  | @ -98,8 +95,6 @@ AnimCurCloseScreen(ScreenPtr pScreen) | |||
|     Unwrap(as, pScreen, RealizeCursor); | ||||
|     Unwrap(as, pScreen, UnrealizeCursor); | ||||
|     Unwrap(as, pScreen, RecolorCursor); | ||||
|     ret = (*pScreen->CloseScreen) (pScreen); | ||||
|     return ret; | ||||
| } | ||||
| 
 | ||||
| static void | ||||
|  | @ -286,7 +281,7 @@ AnimCurInit(ScreenPtr pScreen) | |||
| 
 | ||||
|     as = GetAnimCurScreen(pScreen); | ||||
| 
 | ||||
|     Wrap(as, pScreen, CloseScreen, AnimCurCloseScreen); | ||||
|     dixScreenHookClose(pScreen, AnimCurScreenClose, NULL); | ||||
| 
 | ||||
|     Wrap(as, pScreen, CursorLimits, AnimCurCursorLimits); | ||||
|     Wrap(as, pScreen, DisplayCursor, AnimCurDisplayCursor); | ||||
|  |  | |||
|  | @ -76,15 +76,11 @@ picture_window_destructor(ScreenPtr pScreen, WindowPtr pWindow, void *arg) | |||
|     } | ||||
| } | ||||
| 
 | ||||
| static Bool | ||||
| PictureCloseScreen(ScreenPtr pScreen) | ||||
| static void PictureScreenClose(ScreenPtr pScreen, void *arg) | ||||
| { | ||||
|     PictureScreenPtr ps = GetPictureScreen(pScreen); | ||||
|     Bool ret; | ||||
|     int n; | ||||
| 
 | ||||
|     pScreen->CloseScreen = ps->CloseScreen; | ||||
|     ret = (*pScreen->CloseScreen) (pScreen); | ||||
|     PictureResetFilters(pScreen); | ||||
|     for (n = 0; n < ps->nformats; n++) | ||||
|         if (ps->formats[n].type == PictTypeIndexed) | ||||
|  | @ -93,7 +89,6 @@ PictureCloseScreen(ScreenPtr pScreen) | |||
|     SetPictureScreen(pScreen, 0); | ||||
|     free(ps->formats); | ||||
|     free(ps); | ||||
|     return ret; | ||||
| } | ||||
| 
 | ||||
| static void | ||||
|  | @ -684,12 +679,11 @@ PictureInit(ScreenPtr pScreen, PictFormatPtr formats, int nformats) | |||
| 
 | ||||
|     ps->subpixel = SubPixelUnknown; | ||||
| 
 | ||||
|     ps->CloseScreen = pScreen->CloseScreen; | ||||
|     ps->StoreColors = pScreen->StoreColors; | ||||
|     pScreen->CloseScreen = PictureCloseScreen; | ||||
|     pScreen->StoreColors = PictureStoreColors; | ||||
| 
 | ||||
|     dixScreenHookWindowDestroy(pScreen, picture_window_destructor, NULL); | ||||
|     dixScreenHookClose(pScreen, PictureScreenClose, NULL); | ||||
| 
 | ||||
|     if (!PictureSetDefaultFilters(pScreen)) { | ||||
|         PictureResetFilters(pScreen); | ||||
|  |  | |||
|  | @ -294,8 +294,6 @@ typedef struct _PictureScreen { | |||
|     GlyphsProcPtr Glyphs;       /* unused */ | ||||
|     CompositeRectsProcPtr CompositeRects; | ||||
| 
 | ||||
|     CloseScreenProcPtr CloseScreen; | ||||
| 
 | ||||
|     StoreColorsProcPtr StoreColors; | ||||
| 
 | ||||
|     InitIndexedProcPtr InitIndexed; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue