aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2009-11-23 19:43:23 +0000
committermarha <marha@users.sourceforge.net>2009-11-23 19:43:23 +0000
commit96b4fdae776275766a999eb6fcf94827b1073bba (patch)
tree9c40fcf64fb7e6b22bc0236a940c93d034571350
parentd0e1262517c1a1e47a823dbfb4cd28ac60a7148c (diff)
downloadvcxsrv-96b4fdae776275766a999eb6fcf94827b1073bba.tar.gz
vcxsrv-96b4fdae776275766a999eb6fcf94827b1073bba.tar.bz2
vcxsrv-96b4fdae776275766a999eb6fcf94827b1073bba.zip
winGetWindowInfo: avoid creating unnecessary regions
-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;