trying to changes
authorvlad <vlad@vlanout.(none)>
Wed, 11 Aug 2010 19:10:36 +0000 (22:10 +0300)
committervlad <vlad@vlanout.(none)>
Wed, 11 Aug 2010 19:10:36 +0000 (22:10 +0300)
xscreensaver/hacks/screenhack.c

index f4319cc..21847e7 100644 (file)
@@ -582,14 +582,24 @@ run_screenhack_table (Display *dpy,
          fprintf(stderr, "Connection Null\n"); 
          exit(1); 
   }
+  if (view == 1){
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='pause_livebg_on_view1'", NULL);
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='play_livebg_on_view1'", NULL);
+  }
+  if (view == 2){
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='pause_livebg_on_view2'", NULL);
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='play_livebg_on_view2'", NULL);
+  }
+  if (view == 3){
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='pause_livebg_on_view3'", NULL);
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='play_livebg_on_view3'", NULL);
+  }
+  if (view == 4){
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='pause_livebg_on_view4'", NULL);
+       dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp', member='play_livebg_on_view4'", NULL);
+  }
 
-  dbus_bus_add_match (conn, "type='signal', interface='org.maemo.livewp'", &err);
   dbus_connection_flush(conn);
-  if (dbus_error_is_set(&err)){
-     fprintf(stderr,"dbus_bus_add_match failed: %s", err.message);
-     dbus_error_free(&err);
-     exit (1);
-  }
 
   while (1)
     {
@@ -623,7 +633,7 @@ run_screenhack_table (Display *dpy,
        dbus_connection_read_write(conn, 0);
       else
       /* blocking read of the next available message */
-       dbus_connection_read_write(conn, 1000);
+       dbus_connection_read_write(conn, -1);
         /*fprintf(stderr, "111111\n");*/
       /*  msg = dbus_connection_borrow_message(conn); */
 
@@ -659,7 +669,6 @@ run_screenhack_table (Display *dpy,
               }
               /*msg = dbus_connection_pop_message(conn);*/
               fprintf(stderr, "dbus  steal message\n"); 
-             dbus_message_unref (msg);
               /*dbus_connection_steal_borrowed_message(conn, msg);*/
           }else{ 
               fprintf(stderr, "dbus  return message\n"); 
@@ -667,6 +676,7 @@ run_screenhack_table (Display *dpy,
           }
       }    
       
+      dbus_message_unref (msg);
       /* 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))||