rootless: use window destructor hook
Wrapping ScreenRec's function pointers is problematic for many reasons, so use the new window destructor hook instead. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
c3d780d07f
commit
f061315afa
|
@ -84,7 +84,6 @@ typedef struct _RootlessScreenRec {
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
|
|
||||||
CreateWindowProcPtr CreateWindow;
|
CreateWindowProcPtr CreateWindow;
|
||||||
DestroyWindowProcPtr DestroyWindow;
|
|
||||||
RealizeWindowProcPtr RealizeWindow;
|
RealizeWindowProcPtr RealizeWindow;
|
||||||
UnrealizeWindowProcPtr UnrealizeWindow;
|
UnrealizeWindowProcPtr UnrealizeWindow;
|
||||||
MoveWindowProcPtr MoveWindow;
|
MoveWindowProcPtr MoveWindow;
|
||||||
|
|
|
@ -37,6 +37,7 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include "dix/colormap_priv.h"
|
#include "dix/colormap_priv.h"
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
|
|
||||||
#include "scrnintstr.h"
|
#include "scrnintstr.h"
|
||||||
|
@ -649,6 +650,8 @@ RootlessWrap(ScreenPtr pScreen)
|
||||||
{
|
{
|
||||||
RootlessScreenRec *s = SCREENREC(pScreen);
|
RootlessScreenRec *s = SCREENREC(pScreen);
|
||||||
|
|
||||||
|
dixScreenHookWindowDestroy(pScreen, RootlessWindowDestroy);
|
||||||
|
|
||||||
#define WRAP(a) \
|
#define WRAP(a) \
|
||||||
if (pScreen->a) { \
|
if (pScreen->a) { \
|
||||||
s->a = pScreen->a; \
|
s->a = pScreen->a; \
|
||||||
|
@ -666,7 +669,6 @@ RootlessWrap(ScreenPtr pScreen)
|
||||||
WRAP(GetImage);
|
WRAP(GetImage);
|
||||||
WRAP(SourceValidate);
|
WRAP(SourceValidate);
|
||||||
WRAP(CreateWindow);
|
WRAP(CreateWindow);
|
||||||
WRAP(DestroyWindow);
|
|
||||||
WRAP(RealizeWindow);
|
WRAP(RealizeWindow);
|
||||||
WRAP(UnrealizeWindow);
|
WRAP(UnrealizeWindow);
|
||||||
WRAP(MoveWindow);
|
WRAP(MoveWindow);
|
||||||
|
|
|
@ -36,9 +36,10 @@
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
|
#include "dix/dix_priv.h"
|
||||||
|
#include "dix/screen_hooks_priv.h"
|
||||||
#include "fb/fb_priv.h"
|
#include "fb/fb_priv.h"
|
||||||
#include "mi/mi_priv.h"
|
#include "mi/mi_priv.h"
|
||||||
#include "dix_priv.h"
|
|
||||||
|
|
||||||
#ifdef __APPLE__
|
#ifdef __APPLE__
|
||||||
#include <Xplugin.h>
|
#include <Xplugin.h>
|
||||||
|
@ -189,24 +190,14 @@ RootlessDestroyFrame(WindowPtr pWin, RootlessWindowPtr winRec)
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RootlessDestroyWindow
|
* @brief window destructor: remove physical window associated with given window
|
||||||
* Destroy the physical window associated with the given window.
|
|
||||||
*/
|
*/
|
||||||
Bool
|
void
|
||||||
RootlessDestroyWindow(WindowPtr pWin)
|
RootlessWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin)
|
||||||
{
|
{
|
||||||
RootlessWindowRec *winRec = WINREC(pWin);
|
RootlessWindowRec *winRec = WINREC(pWin);
|
||||||
Bool result;
|
if (winRec != NULL)
|
||||||
|
|
||||||
if (winRec != NULL) {
|
|
||||||
RootlessDestroyFrame(pWin, winRec);
|
RootlessDestroyFrame(pWin, winRec);
|
||||||
}
|
|
||||||
|
|
||||||
SCREEN_UNWRAP(pWin->drawable.pScreen, DestroyWindow);
|
|
||||||
result = pWin->drawable.pScreen->DestroyWindow(pWin);
|
|
||||||
SCREEN_WRAP(pWin->drawable.pScreen, DestroyWindow);
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static Bool
|
static Bool
|
||||||
|
|
|
@ -37,7 +37,7 @@
|
||||||
#include "rootlessCommon.h"
|
#include "rootlessCommon.h"
|
||||||
|
|
||||||
Bool RootlessCreateWindow(WindowPtr pWin);
|
Bool RootlessCreateWindow(WindowPtr pWin);
|
||||||
Bool RootlessDestroyWindow(WindowPtr pWin);
|
void RootlessWindowDestroy(CallbackListPtr *pcbl, ScreenPtr pScreen, WindowPtr pWin);
|
||||||
|
|
||||||
void RootlessSetShape(WindowPtr pWin, int kind);
|
void RootlessSetShape(WindowPtr pWin, int kind);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue