changed dbus send param
authortanya <tanyshk@gmail.com>
Wed, 11 Aug 2010 09:28:54 +0000 (12:28 +0300)
committertanya <tanyshk@gmail.com>
Wed, 11 Aug 2010 09:28:54 +0000 (12:28 +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..5515ad4 100644 (file)
@@ -532,15 +532,18 @@ run_screenhack_table (Display *dpy,
 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW2 "pause_livebg_on_view2"                                                                                                 
 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW3 "pause_livebg_on_view3"                                                                                                 
 #define LIVEWP_PAUSE_LIVEBG_ON_VIEW4 "pause_livebg_on_view4"
+#define LIVEWP_PAUSE_LIVEBG_ON_VIEW "pause_livebg_on_view"
 #define LIVEWP_PLAY_LIVEBG_ON_VIEW1 "play_livebg_on_view1"                                                                                                   
 #define LIVEWP_PLAY_LIVEBG_ON_VIEW2 "play_livebg_on_view2"                                                                                                   
 #define LIVEWP_PLAY_LIVEBG_ON_VIEW3 "play_livebg_on_view3"                                                                                                   
 #define LIVEWP_PLAY_LIVEBG_ON_VIEW4 "play_livebg_on_view4" 
+#define LIVEWP_PLAY_LIVEBG_ON_VIEW "play_livebg_on_view" 
    DBusMessage* msg;
    DBusConnection* conn;
    DBusError err;
    int ret;
    char pause = 0;
+   int param = 0;
 
   /* Kludge: even though the init_cb functions are declared to take 2 args,
      actually call them with 3, for the benefit of xlockmore_init() and
@@ -584,6 +587,7 @@ run_screenhack_table (Display *dpy,
      dbus_error_free(&err);
      exit (1);
   }
+  DBusMessageIter args;
   while (1)
     {
       if (pause == 0){ 
@@ -612,7 +616,30 @@ run_screenhack_table (Display *dpy,
       msg = dbus_connection_pop_message(conn);
       if (NULL == msg)  
           continue; 
+
+      if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW) || 
+          dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW)){
+          if (!dbus_message_iter_init(msg, &args))
+              fprintf(stderr, "dbus message has no param\n");
+          else if (DBUS_TYPE_INT32 != dbus_message_iter_get_arg_type(&args))             
+              fprintf(stderr, "dbus message param is not int \n");
+          else{ 
+              dbus_message_iter_get_basic(&args, &param);
+              fprintf(stderr, "dbus param = %i\n", param);
+          }
+          if (param == view){
+              if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW)){
+                 fprintf(stderr, "dbus  Pause scene visible %i\n", param); 
+                    pause = 1;
+              }
+              if (dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PLAY_LIVEBG_ON_VIEW)){
+                 fprintf(stderr, "dbus   Play scene visible %i\n", param); 
+                    pause = 0;
+              }
+          }
+      }    
       /* 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))||
           (view == 3 && dbus_message_is_signal(msg, LIVEWP_SIGNAL_INTERFACE, LIVEWP_PAUSE_LIVEBG_ON_VIEW3))||
@@ -628,7 +655,8 @@ run_screenhack_table (Display *dpy,
            fprintf(stderr, "Play scene visible %i\n", view); 
           pause = 0;
       }
-
+*/
+      
     }
 
   ft->free_cb (dpy, window, closure);