[prev in list] [next in list] [prev in thread] [next in thread]
List: helix-video-cvs
Subject: [Video-cvs] sitelib/platform/win winsite.cpp,1.12,1.13
From: jeffl () helixcommunity ! org
Date: 2006-04-07 20:33:24
[Download RAW message or body]
Update of /cvsroot/video/sitelib/platform/win
In directory cvs02.internal.helixcommunity.org:/tmp/cvs-serv22563/sitelib/platform/win
Modified Files:
winsite.cpp
Log Message:
The site can either create its own window for rendering video or it can be given a \
window by the TLC. When it is given a window from the TLC it typically takes over \
the window's events completely. In most of the use cases so far this hasn't been a \
problem, but there is a new use case in which this causes a problem. If the site is \
still given a window (the parent window) and this window shares space with other UI \
controls so that the video just renders at a certain position and size within the \
window the site needs to work in a passive mode so that it doesn't interfere with the \
event handling for other controls. This fix only addresses an issue with painting. \
The site code doesn't need to call BeginPaint/EndPaint to get the update rect. If it \
does it will validate the entire update region and the TLC won't be able to paint the \
rest of the window. This change makes sure that the site just retrieves the update \
rect and the forwards the paint event on to the original wndproc. If the site \
created its own window then it will go to its windowproc, this forward on the \
DefWndProc which will validate the update rect. If the site doesn't create the \
window the paint will go correctly to the original wndproc and the TLC can do its own \
painting.
CR by Greg Wright
Index: winsite.cpp
===================================================================
RCS file: /cvsroot/video/sitelib/platform/win/winsite.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- winsite.cpp 10 Mar 2006 00:48:10 -0000 1.12
+++ winsite.cpp 7 Apr 2006 20:33:22 -0000 1.13
@@ -954,6 +954,9 @@
//Before we do anything we give the native event to the renderer.
HXxEvent event = {0,0,0,0,0,0};
+ RECT updateRect = { 0, 0, 0, 0 };
+ HDC hDC = NULL;
+
AddRef();
HXBOOL retValue = FALSE;
@@ -1174,15 +1177,15 @@
switch (message)
{
case WM_PAINT:
- PAINTSTRUCT ps;
- ::BeginPaint(hWnd,&ps);
- boundsRect.left = ps.rcPaint.left;
- boundsRect.right = ps.rcPaint.right;
- boundsRect.top = ps.rcPaint.top;
- boundsRect.bottom = ps.rcPaint.bottom;
+ ::GetUpdateRect(hWnd, &updateRect, FALSE);
+ boundsRect.left = updateRect.left;
+ boundsRect.right = updateRect.right;
+ boundsRect.top = updateRect.top;
+ boundsRect.bottom = updateRect.bottom;
- m_pTopLevelSite->CheckDisplayMode(ps.hdc);
- ::EndPaint(hWnd,&ps);
+ hDC = ::GetDC(hWnd);
+ m_pTopLevelSite->CheckDisplayMode(hDC);
+ ::ReleaseDC(hWnd, hDC);
//Take care of all the dirty rects for all sites
m_pTopLevelSite->ManageExposeEvents(&boundsRect);
@@ -1222,7 +1225,6 @@
// }
lResult = 0;
- retValue = TRUE;
goto leave;
break;
case WM_MOUSEMOVE:
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic