(!1714) xfixes: 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
							
								
									cb75dab63b
								
							
						
					
					
						commit
						d2c08c4cc2
					
				|  | @ -118,7 +118,6 @@ typedef struct _CursorHideCountRec { | ||||||
| 
 | 
 | ||||||
| typedef struct _CursorScreen { | typedef struct _CursorScreen { | ||||||
|     DisplayCursorProcPtr DisplayCursor; |     DisplayCursorProcPtr DisplayCursor; | ||||||
|     CloseScreenProcPtr CloseScreen; |  | ||||||
|     CursorHideCountPtr pCursorHideCounts; |     CursorHideCountPtr pCursorHideCounts; | ||||||
| } CursorScreenRec, *CursorScreenPtr; | } CursorScreenRec, *CursorScreenPtr; | ||||||
| 
 | 
 | ||||||
|  | @ -192,20 +191,15 @@ CursorDisplayCursor(DeviceIntPtr pDev, ScreenPtr pScreen, CursorPtr pCursor) | ||||||
|     return ret; |     return ret; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| static Bool | static void CursorScreenClose(ScreenPtr pScreen, void *arg) | ||||||
| CursorCloseScreen(ScreenPtr pScreen) |  | ||||||
| { | { | ||||||
|     CursorScreenPtr cs = GetCursorScreen(pScreen); |     CursorScreenPtr cs = GetCursorScreen(pScreen); | ||||||
|     Bool ret; |  | ||||||
|     _X_UNUSED CloseScreenProcPtr close_proc; |  | ||||||
|     _X_UNUSED DisplayCursorProcPtr display_proc; |     _X_UNUSED DisplayCursorProcPtr display_proc; | ||||||
| 
 | 
 | ||||||
|     Unwrap(cs, pScreen, CloseScreen, close_proc); |     dixScreenUnhookClose(pScreen, CursorScreenClose, arg); | ||||||
|     Unwrap(cs, pScreen, DisplayCursor, display_proc); |     Unwrap(cs, pScreen, DisplayCursor, display_proc); | ||||||
|     deleteCursorHideCountsForScreen(pScreen); |     deleteCursorHideCountsForScreen(pScreen); | ||||||
|     ret = (*pScreen->CloseScreen) (pScreen); |  | ||||||
|     free(cs); |     free(cs); | ||||||
|     return ret; |  | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| #define CursorAllEvents (XFixesDisplayCursorNotifyMask) | #define CursorAllEvents (XFixesDisplayCursorNotifyMask) | ||||||
|  | @ -1087,7 +1081,7 @@ XFixesCursorInit(void) | ||||||
|         cs = (CursorScreenPtr) calloc(1, sizeof(CursorScreenRec)); |         cs = (CursorScreenPtr) calloc(1, sizeof(CursorScreenRec)); | ||||||
|         if (!cs) |         if (!cs) | ||||||
|             return FALSE; |             return FALSE; | ||||||
|         Wrap(cs, pScreen, CloseScreen, CursorCloseScreen); |         dixScreenHookClose(pScreen, CursorScreenClose, NULL); | ||||||
|         Wrap(cs, pScreen, DisplayCursor, CursorDisplayCursor); |         Wrap(cs, pScreen, DisplayCursor, CursorDisplayCursor); | ||||||
|         cs->pCursorHideCounts = NULL; |         cs->pCursorHideCounts = NULL; | ||||||
|         SetCursorScreen(pScreen, cs); |         SetCursorScreen(pScreen, cs); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue