diff options
author | Pierre-Eric Pelloux-Prayer <pierre-eric@lanedo.com> | 2013-07-05 14:17:46 +0200 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2013-07-09 15:34:59 +0000 |
commit | 21a9089aa4324ccbdc9e9ee3669e5fb524efd03c (patch) | |
tree | a284fd01001f9e76074b73f0cd29b23a31b73e92 /vcl/unx | |
parent | dc2aa496c0252ef4a95289935eeac3340de1ca8b (diff) |
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@suse.cz>
Tested-by: Petr Mladek <pmladek@suse.cz>
Diffstat (limited to 'vcl/unx')
-rw-r--r-- | vcl/unx/gtk/app/gtkdata.cxx | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/vcl/unx/gtk/app/gtkdata.cxx b/vcl/unx/gtk/app/gtkdata.cxx index 6abb06b13205..5ff5a8010f7a 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 ) { |