CR:[RESEND] Fix to get the correct window for blitting for Unix
"Lovish Dhawan" <[email protected]>
| Newsgroups | gmane.comp.multimedia.helix.devel |
|---|---|
| Message-ID | <017a01c8bb49$19e824b0$8001a8c0@dhawan> |
----- Original Message ----- From: Lovish Dhawan To: [email protected] Cc: [email protected] Sent: Monday, May 19, 2008 2:23 PM Subject: CR:Fix to get the correct window for blitting Synopsis: Changes to fix to get the correct window for blitting. Overview: When we go to fullscreen then we create a new window and this is passed for blitting. We were not attaching the new window. Now that we dont have the new (fullscreen window) right away so schedule a callback for the same with 100 ms This fixes the issue and we dont have to update the m_window Files Added: None Files Modified: /cvsroot/video/sitelib/platform/unix/unixsite.cpp /cvsroot/video/sitelib/pub/platform/unix/unixsite.h Image Size and Heap Use impact (Client -Only): None. Platforms and Profiles Affected: None Distribution Libraries Affected: None Distribution library impact and planned action: None Platforms and Profiles Build Verified: BIF branch -> wombat Target(s) -> LitePlayerWombat Profile -> helix-client-all-defines SYSTEM_ID -> linux-2.2-libc6-gcc32-i586 Branch: hxclient_3_1_0_atlas, HEAD Files Attached: video_sitelib.diff.txt _______________________________________________ Helix-client-dev mailing list [email protected] http://lists.helixcommunity.org/mailman/listinfo/helix-client-dev
video_sitelib.diff.txt
(text/plain, 3.5 KB)
Index: platform/unix/unixsite.cpp
===================================================================
RCS file: /cvsroot/video/sitelib/platform/unix/unixsite.cpp,v
retrieving revision 1.18.2.3
diff -u -r1.18.2.3 unixsite.cpp
--- platform/unix/unixsite.cpp 7 May 2008 07:05:44 -0000 1.18.2.3
+++ platform/unix/unixsite.cpp 19 May 2008 07:56:23 -0000
@@ -126,12 +126,14 @@
, m_bDamaged(FALSE)
, m_bIgnoreFocusOutInFS(FALSE)
, m_bReparent(FALSE)
+ , m_pAttachWindowCallback(NULL)
{
m_ptScrollVertPosT.x = m_ptScrollVertPosT.y = 0;
m_ptScrollVertPosB.x = m_ptScrollVertPosB.y = 0;
m_ptScrollHorizPosR.x = m_ptScrollHorizPosR.y = 0;
m_ptScrollHorizPosL.x = m_ptScrollHorizPosL.y = 0;
m_ptFullScreenOffset.x = m_ptFullScreenOffset.y = 0;
memset( &m_PreFullScreenSize, 0, sizeof( m_PreFullScreenSize ) );
HX_ASSERT( m_pContext );
@@ -150,6 +152,8 @@
CHXUnixSite::~CHXUnixSite()
{
+ RemovePendingCallback(m_pAttachWindowCallback);
+ HX_RELEASE(m_pAttachWindowCallback);
void* pDummy;
if (z_mapSiteToWindow.Lookup((void*)this, pDummy))
{
@@ -2406,12 +2410,45 @@
{
m_pStatusText->ParentChangedSize();
m_pStatusText->Show();
+ }
+
+ if(!m_pAttachWindowCallback)
+ {
+ m_pAttachWindowCallback = new CHXGenericCallback((void*)this, (fGenericCBFunc)AttachWindowCallback);
+ m_pAttachWindowCallback->AddRef();
+ }
+
+ // schedule callback for Attaching Window
+ if(m_pAttachWindowCallback)
+ {
+ m_pAttachWindowCallback->CallbackScheduled(m_pScheduler->RelativeEnter(m_pAttachWindowCallback, 100));
}
return HXR_OK;
}
+void CHXUnixSite::AttachWindowCallback(void* pParam)
+{
+ CHXUnixSite* pObj = (CHXUnixSite*)pParam;
+
+ if (pObj)
+ {
+ pObj->_AttachWindow();
+ }
+}
+
+void CHXUnixSite::RemovePendingCallback(CHXGenericCallback* pCB)
+{
+ if (pCB &&
+ pCB->GetPendingCallback() &&
+ m_pScheduler)
+ {
+ m_pScheduler->Remove(pCB->GetPendingCallback());
+ pCB->CallbackCanceled();
+ }
+}
+
HX_RESULT CHXUnixSite::_EnterFullScreenExt(HXxWindow* pWindow, IHXValues* pValues)
{
m_bReparent = FALSE;
@@ -2441,8 +2478,12 @@
HX_RESULT CHXUnixSite::_ExitFullScreenExt()
{
HX_RESULT res = _ExitFullScreen();
+ // schedule callback for attaching window
+ if(m_pAttachWindowCallback)
+ {
+ m_pAttachWindowCallback->CallbackScheduled(m_pScheduler->RelativeEnter(m_pAttachWindowCallback, 100));
+ }
CHXBaseSite::FullScreenExited(res);
-
return res;
}
Index: pub/platform/unix/unixsite.h
===================================================================
RCS file: /cvsroot/video/sitelib/pub/platform/unix/unixsite.h,v
retrieving revision 1.10.2.1
diff -u -r1.10.2.1 unixsite.h
--- pub/platform/unix/unixsite.h 7 May 2008 07:11:48 -0000 1.10.2.1
+++ pub/platform/unix/unixsite.h 19 May 2008 07:56:24 -0000
@@ -61,6 +61,7 @@
#endif
#include "basesite.h"
+#include "hxcbobj.h"
class CHXUnixSite : public CHXBaseSite
{
@@ -216,9 +217,11 @@
const char* pszStatusText );
virtual HX_RESULT _EnterFullScreenExt(HXxWindow* pWindow, IHXValues* pValues);
virtual HX_RESULT _ExitFullScreenExt();
+ static void AttachWindowCallback(void *pParam);
+ void RemovePendingCallback(CHXGenericCallback* pCB);
-
- HXBOOL m_bReparent;
+ HXBOOL m_bReparent;
+ CHXGenericCallback* m_pAttachWindowCallback;
private: