On 03/10/2011 03:35 PM, Guillaume Destuynder wrote:
> 
>>
>> The problem is, that the viewer is (for windows) too busy for
>> delivering the WM_PAINT. TLS seems to be a reliable trigger, but it
>> should be possible to construct work loads for the non-TLS case too,
>> where the screen updates are stalled.
>>
>> How can it be fixed:
>>
>> 1) The situation can be improved, if in win/vncviewer/CConn.cxx the priority 
>> of
>> the Windows events is raised:
>> In CConn::blockCallback():
>>     // Wait for socket data, or a message to process
>>     DWORD result = MsgWaitForMultipleObjects(1, &sockEvent.h, FALSE, 
>> INFINITE, QS_ALLINPUT);
>>     if (result == WAIT_OBJECT_0) {
>>       // - Network event notification.  Return control to I/O routine.
>>       break;
>>     } else if (result == WAIT_FAILED) {
>>       // - The wait operation failed - raise an exception
>>       throw rdr::SystemException("blockCallback wait error", GetLastError());
>>     }
>>
>>     // - There should be a message in the message queue
>>     MSG msg;
>>     while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
>>       // IMPORTANT: We mustn't call TranslateMessage() here, because instead 
>> we
>>       // call ToAscii() in CKeyboard::keyEvent().  ToAscii() stores dead key
>>       // state from one call to the next, which would be messed up by calls 
>> to
>>       // TranslateMessage() (actually it looks like TranslateMessage() calls
>>       // ToAscii() internally).
>>       DispatchMessage(&msg);
>>     }
>> =>
>>     // Wait for socket data, or a message to process
>>     DWORD result = MsgWaitForMultipleObjects(1, &sockEvent.h, FALSE, 
>> INFINITE, QS_ALLINPUT);
>>     if (result == WAIT_FAILED) {
>>       // - The wait operation failed - raise an exception
>>       throw rdr::SystemException("blockCallback wait error", GetLastError());
>>     }
>>
>>     MSG msg;
>>     while (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE)) {
>>       // IMPORTANT: We mustn't call TranslateMessage() here, because instead 
>> we
>>       // call ToAscii() in CKeyboard::keyEvent().  ToAscii() stores dead key
>>       // state from one call to the next, which would be messed up by calls 
>> to
>>       // TranslateMessage() (actually it looks like TranslateMessage() calls
>>       // ToAscii() internally).
>>       DispatchMessage(&msg);
>>     }
>>     if (result == WAIT_OBJECT_0) {
>>       // - Network event notification.  Return control to I/O routine.
>>       break;
>>     }

After some more testing, I had to add this patch as well or in some
occasions the DesktopWindow thread would be blocked (including the
timer), waiting for the above events and messages.


-- 
Guillaume Destuynder - m-privacy GmbH -

Am Köllnischen Park 1, 10179 Berlin
Tel: +49 30 24342334
Fax: +49 30 24342336
Web: http://www.m-privacy.de, http://oss.m-privacy.de
Handelsregister:
 Amtsgericht Charlottenburg HRB 84946
Geschäftsführer:
 Dipl.-Kfm. Holger Maczkowsky,
 Roman Maczkowsky
GnuPG-Key-ID: 0x3FB1D217

------------------------------------------------------------------------------
Colocation vs. Managed Hosting
A question and answer guide to determining the best fit
for your organization - today and in the future.
http://p.sf.net/sfu/internap-sfd2d
_______________________________________________
Tigervnc-devel mailing list
Tigervnc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-devel

Reply via email to