From: Vlad Date: Wed, 11 Aug 2010 08:23:50 +0000 (+0300) Subject: fixed dbus problem. Now CPU idle ok X-Git-Url: http://vcs.maemo.org/git/?p=xscreensaver;a=commitdiff_plain;h=5e2ecf8ae7b86ff942b8c6a5b92b9bfabd3e1346 fixed dbus problem. Now CPU idle ok --- diff --git a/xscreensaver/config.guess b/xscreensaver/config.guess old mode 100755 new mode 100644 diff --git a/xscreensaver/config.sub b/xscreensaver/config.sub old mode 100755 new mode 100644 diff --git a/xscreensaver/hacks/screenhack.c b/xscreensaver/hacks/screenhack.c index 273c2e1..0f11991 100644 --- a/xscreensaver/hacks/screenhack.c +++ b/xscreensaver/hacks/screenhack.c @@ -607,11 +607,16 @@ run_screenhack_table (Display *dpy, break; } + if (pause == 0) /* non blocking read of the next available message */ - dbus_connection_read_write(conn, 0); + dbus_connection_read_write(conn, 0); + else + /* blocking read of the next available message */ + dbus_connection_read_write(conn, -1); msg = dbus_connection_pop_message(conn); - if (NULL == msg) + if (NULL == msg){ continue; + } /* check this is a method call for the right interface & method */ if ((view == 1 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW1))|| (view == 2 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW2))|| @@ -619,6 +624,7 @@ run_screenhack_table (Display *dpy, (view == 4 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW4))){ fprintf(stderr, "Pause scene visible %i\n", view); pause = 1; + dbus_message_unref (msg); continue; } if ((view == 1 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW1))|| @@ -627,8 +633,10 @@ run_screenhack_table (Display *dpy, (view == 4 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW4))){ fprintf(stderr, "Play scene visible %i\n", view); pause = 0; + dbus_message_unref (msg); + continue; } - + dbus_message_unref (msg); } ft->free_cb (dpy, window, closure);