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))||
(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))||
(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);