xfree86: randr: 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
623171ce3f
commit
b0f1bc92e5
|
@ -28,6 +28,7 @@
|
||||||
#include <X11/X.h>
|
#include <X11/X.h>
|
||||||
|
|
||||||
#include "dix/input_priv.h"
|
#include "dix/input_priv.h"
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
|
|
||||||
#include "os.h"
|
#include "os.h"
|
||||||
#include "globals.h"
|
#include "globals.h"
|
||||||
|
@ -40,7 +41,6 @@
|
||||||
#include "inputstr.h"
|
#include "inputstr.h"
|
||||||
|
|
||||||
typedef struct _xf86RandRInfo {
|
typedef struct _xf86RandRInfo {
|
||||||
CloseScreenProcPtr CloseScreen;
|
|
||||||
int virtualX;
|
int virtualX;
|
||||||
int virtualY;
|
int virtualY;
|
||||||
int mmWidth;
|
int mmWidth;
|
||||||
|
@ -341,19 +341,22 @@ xf86RandRSetConfig(ScreenPtr pScreen,
|
||||||
/*
|
/*
|
||||||
* Reset size back to original
|
* Reset size back to original
|
||||||
*/
|
*/
|
||||||
static Bool
|
static void xf86RandRCloseScreen(CallbackListPtr *pcbl,
|
||||||
xf86RandRCloseScreen(ScreenPtr pScreen)
|
ScreenPtr pScreen, void *unused)
|
||||||
{
|
{
|
||||||
ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
|
ScrnInfoPtr scrp = xf86ScreenToScrn(pScreen);
|
||||||
|
if (!scrp)
|
||||||
|
return;
|
||||||
|
|
||||||
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
XF86RandRInfoPtr randrp = XF86RANDRINFO(pScreen);
|
||||||
|
|
||||||
scrp->virtualX = pScreen->width = randrp->virtualX;
|
scrp->virtualX = pScreen->width = randrp->virtualX;
|
||||||
scrp->virtualY = pScreen->height = randrp->virtualY;
|
scrp->virtualY = pScreen->height = randrp->virtualY;
|
||||||
scrp->currentMode = scrp->modes;
|
scrp->currentMode = scrp->modes;
|
||||||
pScreen->CloseScreen = randrp->CloseScreen;
|
|
||||||
|
dixScreenUnhookClose(pScreen, xf86RandRCloseScreen);
|
||||||
free(randrp);
|
free(randrp);
|
||||||
dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL);
|
dixSetPrivate(&pScreen->devPrivates, xf86RandRKey, NULL);
|
||||||
return (*pScreen->CloseScreen) (pScreen);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rotation
|
Rotation
|
||||||
|
@ -438,8 +441,7 @@ xf86RandRInit(ScreenPtr pScreen)
|
||||||
randrp->mmWidth = pScreen->mmWidth;
|
randrp->mmWidth = pScreen->mmWidth;
|
||||||
randrp->mmHeight = pScreen->mmHeight;
|
randrp->mmHeight = pScreen->mmHeight;
|
||||||
|
|
||||||
randrp->CloseScreen = pScreen->CloseScreen;
|
dixScreenHookClose(pScreen, xf86RandRCloseScreen);
|
||||||
pScreen->CloseScreen = xf86RandRCloseScreen;
|
|
||||||
|
|
||||||
randrp->rotation = RR_Rotate_0;
|
randrp->rotation = RR_Rotate_0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue