present: 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
710079a334
commit
4ca68c30aa
|
@ -163,7 +163,6 @@ typedef void (*present_priv_flip_destroy_ptr)(ScreenPtr screen);
|
||||||
|
|
||||||
struct present_screen_priv {
|
struct present_screen_priv {
|
||||||
ScreenPtr pScreen;
|
ScreenPtr pScreen;
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
ConfigNotifyProcPtr ConfigNotify;
|
ConfigNotifyProcPtr ConfigNotify;
|
||||||
ClipNotifyProcPtr ClipNotify;
|
ClipNotifyProcPtr ClipNotify;
|
||||||
|
|
||||||
|
|
|
@ -54,18 +54,18 @@ present_get_window_priv(WindowPtr window, Bool create)
|
||||||
/*
|
/*
|
||||||
* Hook the close screen function to clean up our screen private
|
* Hook the close screen function to clean up our screen private
|
||||||
*/
|
*/
|
||||||
static Bool
|
static void present_close_screen(CallbackListPtr *pcbl, ScreenPtr screen, void *unused)
|
||||||
present_close_screen(ScreenPtr screen)
|
|
||||||
{
|
{
|
||||||
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
|
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
|
||||||
|
if (!screen_priv)
|
||||||
|
return;
|
||||||
|
|
||||||
if (screen_priv->flip_destroy)
|
if (screen_priv->flip_destroy)
|
||||||
screen_priv->flip_destroy(screen);
|
screen_priv->flip_destroy(screen);
|
||||||
|
|
||||||
unwrap(screen_priv, screen, CloseScreen);
|
dixScreenUnhookClose(screen, present_close_screen);
|
||||||
(*screen->CloseScreen) (screen);
|
dixSetPrivate(&screen->devPrivates, &present_screen_private_key, NULL);
|
||||||
free(screen_priv);
|
free(screen_priv);
|
||||||
return TRUE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -176,9 +176,8 @@ present_screen_priv_init(ScreenPtr screen)
|
||||||
if (!screen_priv)
|
if (!screen_priv)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
wrap(screen_priv, screen, CloseScreen, present_close_screen);
|
|
||||||
|
|
||||||
dixScreenHookWindowDestroy(screen, present_destroy_window);
|
dixScreenHookWindowDestroy(screen, present_destroy_window);
|
||||||
|
dixScreenHookClose(screen, present_close_screen);
|
||||||
|
|
||||||
wrap(screen_priv, screen, ConfigNotify, present_config_notify);
|
wrap(screen_priv, screen, ConfigNotify, present_config_notify);
|
||||||
wrap(screen_priv, screen, ClipNotify, present_clip_notify);
|
wrap(screen_priv, screen, ClipNotify, present_clip_notify);
|
||||||
|
|
Loading…
Reference in New Issue