mirror of
https://github.com/X11Libre/xserver.git
synced 2026-01-26 05:57:53 +00:00
dix: encapsulate ScreenRec::UnrealizeWindow() call in helper function
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
parent
b9036466dd
commit
a9c2edfffd
@ -308,6 +308,16 @@ void MakePredeclaredAtoms(void);
|
||||
|
||||
void dixFreeScreen(ScreenPtr pScreen);
|
||||
|
||||
/*
|
||||
* @brief call the screen's UnrealizeWindow proc
|
||||
*
|
||||
* Calls the Screen's UnrealizeWindow proc and sets pWin->realized
|
||||
* to FALSE.
|
||||
*
|
||||
* @param pWin the window that's being unrealized
|
||||
*/
|
||||
void dixScreenRaiseUnrealizeWindow(WindowPtr pWin);
|
||||
|
||||
/*
|
||||
* @brief call screen's window destructors
|
||||
* @see dixScreenHookWindowDestroy
|
||||
|
||||
@ -100,3 +100,13 @@ Bool dixScreenRaiseCreateResources(ScreenPtr pScreen)
|
||||
CallCallbacks(&pScreen->hookPostCreateResources, &ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
void dixScreenRaiseUnrealizeWindow(WindowPtr pWin)
|
||||
{
|
||||
if (!pWin)
|
||||
return;
|
||||
|
||||
pWin->realized = FALSE;
|
||||
if (pWin->drawable.pScreen->UnrealizeWindow)
|
||||
pWin->drawable.pScreen->UnrealizeWindow(pWin);
|
||||
}
|
||||
|
||||
10
dix/window.c
10
dix/window.c
@ -999,11 +999,9 @@ static void
|
||||
CrushTree(WindowPtr pWin)
|
||||
{
|
||||
WindowPtr pChild, pSib;
|
||||
UnrealizeWindowProcPtr UnrealizeWindow;
|
||||
|
||||
if (!(pChild = pWin->firstChild))
|
||||
return;
|
||||
UnrealizeWindow = pWin->drawable.pScreen->UnrealizeWindow;
|
||||
while (1) {
|
||||
|
||||
/* go to a leaf node in the window tree */
|
||||
@ -1021,8 +1019,7 @@ CrushTree(WindowPtr pWin)
|
||||
pSib = pChild->nextSib;
|
||||
pChild->viewable = FALSE;
|
||||
if (pChild->realized) {
|
||||
pChild->realized = FALSE;
|
||||
(*UnrealizeWindow) (pChild);
|
||||
dixScreenRaiseUnrealizeWindow(pChild);
|
||||
}
|
||||
FreeWindowResources(pChild);
|
||||
dixFreeObjectWithPrivates(pChild, PRIVATE_WINDOW);
|
||||
@ -2761,15 +2758,12 @@ static void
|
||||
UnrealizeTree(WindowPtr pWin, Bool fromConfigure)
|
||||
{
|
||||
WindowPtr pChild;
|
||||
UnrealizeWindowProcPtr Unrealize;
|
||||
MarkUnrealizedWindowProcPtr MarkUnrealizedWindow;
|
||||
|
||||
Unrealize = pWin->drawable.pScreen->UnrealizeWindow;
|
||||
MarkUnrealizedWindow = pWin->drawable.pScreen->MarkUnrealizedWindow;
|
||||
pChild = pWin;
|
||||
while (1) {
|
||||
if (pChild->realized) {
|
||||
pChild->realized = FALSE;
|
||||
pChild->visibility = VisibilityNotViewable;
|
||||
#ifdef XINERAMA
|
||||
if (!noPanoramiXExtension && !pChild->drawable.pScreen->myNum) {
|
||||
@ -2783,7 +2777,7 @@ UnrealizeTree(WindowPtr pWin, Bool fromConfigure)
|
||||
win->u.win.visibility = VisibilityNotViewable;
|
||||
}
|
||||
#endif /* XINERAMA */
|
||||
(*Unrealize) (pChild);
|
||||
dixScreenRaiseUnrealizeWindow(pChild);
|
||||
DeleteWindowFromAnyEvents(pChild, FALSE);
|
||||
if (pChild->viewable) {
|
||||
pChild->viewable = FALSE;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user