Kaydet (Commit) 21a9089a authored tarafından Pierre-Eric Pelloux-Prayer's avatar Pierre-Eric Pelloux-Prayer Kaydeden (comit) Petr Mladek

gtk/unx: remove successive calls to g_main_context_iteration

Replace the sequence:
    non-blocking call to g_main_context_iteration
    if no-event-recvd
        blocking call to g_main_context_iteration
With this one:
    blocking call to g_main_context_iteration until first evt reveived.
This allows more longer sleep period, when nothing is going on (verified
with strace).

Change-Id: I8f4ea911534c90aea091fd68e9f09db11591392f
Reviewed-on: https://gerrit.libreoffice.org/4777Reviewed-by: 's avatarPetr Mladek <pmladek@suse.cz>
Tested-by: 's avatarPetr Mladek <pmladek@suse.cz>
üst dc2aa496
......@@ -571,12 +571,10 @@ void GtkData::Yield( bool bWait, bool bHandleAllCurrentEvents )
gboolean wasOneEvent = TRUE;
while( nMaxEvents-- && wasOneEvent )
{
wasOneEvent = g_main_context_iteration( NULL, FALSE );
wasOneEvent = g_main_context_iteration( NULL, bWait & !bWasEvent );
if( wasOneEvent )
bWasEvent = true;
}
if( bWait && ! bWasEvent )
bWasEvent = g_main_context_iteration( NULL, TRUE ) != 0;
}
else if( bWait )
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment