xfree86: fbman: 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
0c39ca358e
commit
57b9155a7d
|
@ -25,15 +25,14 @@
|
||||||
* the sale, use or other dealings in this Software without prior written
|
* the sale, use or other dealings in this Software without prior written
|
||||||
* authorization from the copyright holder(s) and author(s).
|
* authorization from the copyright holder(s) and author(s).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef HAVE_XORG_CONFIG_H
|
|
||||||
#include <xorg-config.h>
|
#include <xorg-config.h>
|
||||||
#endif
|
|
||||||
|
#include <X11/X.h>
|
||||||
|
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
|
|
||||||
#include "misc.h"
|
#include "misc.h"
|
||||||
#include "xf86.h"
|
#include "xf86.h"
|
||||||
|
|
||||||
#include <X11/X.h>
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
#include "regionstr.h"
|
#include "regionstr.h"
|
||||||
#include "xf86fbman.h"
|
#include "xf86fbman.h"
|
||||||
|
@ -287,7 +286,6 @@ typedef struct {
|
||||||
FBLinkPtr UsedAreas;
|
FBLinkPtr UsedAreas;
|
||||||
int NumUsedAreas;
|
int NumUsedAreas;
|
||||||
FBLinearLinkPtr LinearAreas;
|
FBLinearLinkPtr LinearAreas;
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
DevUnion *devPrivates;
|
DevUnion *devPrivates;
|
||||||
} FBManager, *FBManagerPtr;
|
} FBManager, *FBManagerPtr;
|
||||||
|
|
||||||
|
@ -1085,15 +1083,18 @@ static FBManagerFuncs xf86FBManFuncs = {
|
||||||
localPurgeUnlockedOffscreenAreas
|
localPurgeUnlockedOffscreenAreas
|
||||||
};
|
};
|
||||||
|
|
||||||
static Bool
|
static void xf86FBCloseScreen(CallbackListPtr *pcbl,
|
||||||
xf86FBCloseScreen(ScreenPtr pScreen)
|
ScreenPtr pScreen, void *unused)
|
||||||
{
|
{
|
||||||
FBLinkPtr pLink, tmp;
|
FBLinkPtr pLink, tmp;
|
||||||
FBLinearLinkPtr pLinearLink, tmp2;
|
FBLinearLinkPtr pLinearLink, tmp2;
|
||||||
FBManagerPtr offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates,
|
FBManagerPtr offman = (FBManagerPtr) dixLookupPrivate(&pScreen->devPrivates,
|
||||||
xf86FBScreenKey);
|
xf86FBScreenKey);
|
||||||
|
|
||||||
pScreen->CloseScreen = offman->CloseScreen;
|
dixScreenUnhookClose(pScreen, xf86FBCloseScreen);
|
||||||
|
|
||||||
|
if (!offman)
|
||||||
|
return;
|
||||||
|
|
||||||
pLink = offman->UsedAreas;
|
pLink = offman->UsedAreas;
|
||||||
while (pLink) {
|
while (pLink) {
|
||||||
|
@ -1115,8 +1116,6 @@ xf86FBCloseScreen(ScreenPtr pScreen)
|
||||||
free(offman->devPrivates);
|
free(offman->devPrivates);
|
||||||
free(offman);
|
free(offman);
|
||||||
dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, NULL);
|
||||||
|
|
||||||
return (*pScreen->CloseScreen) (pScreen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
@ -1178,9 +1177,7 @@ xf86InitFBManagerRegion(ScreenPtr pScreen, RegionPtr FullRegion)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, offman);
|
dixSetPrivate(&pScreen->devPrivates, xf86FBScreenKey, offman);
|
||||||
|
dixScreenHookClose(pScreen, xf86FBCloseScreen);
|
||||||
offman->CloseScreen = pScreen->CloseScreen;
|
|
||||||
pScreen->CloseScreen = xf86FBCloseScreen;
|
|
||||||
|
|
||||||
offman->InitialBoxes = RegionCreate(NULL, 1);
|
offman->InitialBoxes = RegionCreate(NULL, 1);
|
||||||
offman->FreeBoxes = RegionCreate(NULL, 1);
|
offman->FreeBoxes = RegionCreate(NULL, 1);
|
||||||
|
|
Loading…
Reference in New Issue