[Libreoffice-commits] core.git: vcl/unx

Pierre-Eric Pelloux-Prayer pierre-eric at lanedo.com
Tue Jul 9 08:35:21 PDT 2013


 vcl/unx/gtk/app/gtkdata.cxx |    4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

New commits:
commit 21a9089aa4324ccbdc9e9ee3669e5fb524efd03c
Author: Pierre-Eric Pelloux-Prayer <pierre-eric at lanedo.com>
Date:   Fri Jul 5 14:17:46 2013 +0200

    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/4777
    Reviewed-by: Petr Mladek <pmladek at suse.cz>
    Tested-by: Petr Mladek <pmladek at suse.cz>

diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx
index 6abb06b..5ff5a80 100644
--- a/vcl/unx/gtk/app/gtkdata.cxx
+++ b/vcl/unx/gtk/app/gtkdata.cxx
@@ -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 )
         {


More information about the Libreoffice-commits mailing list