aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/hw/xwin/glx
diff options
context:
space:
mode:
Diffstat (limited to 'xorg-server/hw/xwin/glx')
-rw-r--r--xorg-server/hw/xwin/glx/winpriv.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/xorg-server/hw/xwin/glx/winpriv.c b/xorg-server/hw/xwin/glx/winpriv.c
index 5c1aa529a..65477afb2 100644
--- a/xorg-server/hw/xwin/glx/winpriv.c
+++ b/xorg-server/hw/xwin/glx/winpriv.c
@@ -79,11 +79,21 @@ void winGetWindowInfo(WindowPtr pWin, winWindowInfoPtr pWinInfo)
pWinInfo->hwnd = pWinPriv->hWnd;
/* Copy window region */
- if (pWinInfo->hrgn)
- DeleteObject(pWinInfo->hrgn);
- pWinInfo->hrgn = CreateRectRgn(0,0,0,0);
- CombineRgn(pWinInfo->hrgn, pWinPriv->hRgn, pWinPriv->hRgn,
- RGN_COPY);
+ if (pWinPriv->hRgn)
+ {
+ if (!pWinInfo->hrgn)
+ {
+ pWinInfo->hrgn = CreateRectRgn(0,0,0,0);
+ }
+ CombineRgn(pWinInfo->hrgn, pWinPriv->hRgn, pWinPriv->hRgn,
+ RGN_COPY);
+ }
+ else if (pWinInfo->hrgn)
+ {
+ DeleteObject(pWinInfo->hrgn);
+ pWinInfo->hrgn=NULL;
+ }
+
}
return;