fixed dbus problem. Now CPU idle ok
authorVlad <vlad@gas.by>
Wed, 11 Aug 2010 08:23:50 +0000 (11:23 +0300)
committerVlad <vlad@gas.by>
Wed, 11 Aug 2010 08:23:50 +0000 (11:23 +0300)
xscreensaver/config.guess [changed mode: 0755->0644]
xscreensaver/config.sub [changed mode: 0755->0644]
xscreensaver/hacks/screenhack.c

old mode 100755 (executable)
new mode 100644 (file)
old mode 100755 (executable)
new mode 100644 (file)
index 273c2e1..0f11991 100644 (file)
@@ -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);