diff options
author | marha <marha@users.sourceforge.net> | 2009-11-23 19:43:23 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2009-11-23 19:43:23 +0000 |
commit | 96b4fdae776275766a999eb6fcf94827b1073bba (patch) | |
tree | 9c40fcf64fb7e6b22bc0236a940c93d034571350 | |
parent | d0e1262517c1a1e47a823dbfb4cd28ac60a7148c (diff) | |
download | vcxsrv-96b4fdae776275766a999eb6fcf94827b1073bba.tar.gz vcxsrv-96b4fdae776275766a999eb6fcf94827b1073bba.tar.bz2 vcxsrv-96b4fdae776275766a999eb6fcf94827b1073bba.zip |
winGetWindowInfo: avoid creating unnecessary regions
-rw-r--r-- | xorg-server/hw/xwin/glx/winpriv.c | 20 |
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; |