Account for dbus api change in compiz 0.9
+23 −5 · 3 files changed
-
annotate.cc+10 −2 -
fire.cc+8 −2 -
water.cc+5 −1
@@ -14,6 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "annotate.h" +#include <stdio.h> +#include <X11/Xlib.h> Annotate::Annotate() { const char *ofc = "org.freedesktop.compiz"; @@ -23,8 +25,14 @@ Annotate::Annotate() { g_error_free(error); throw DBusException(); } - draw_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/annotate/allscreens/draw", ofc); - clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/annotate/allscreens/clear_key", ofc); + + char draw[256]; + char clear[256]; + snprintf(draw, sizeof(draw), "/org/freedesktop/compiz/annotate/screen%d/draw", DefaultScreen(dpy)); + snprintf(clear, sizeof(clear), "/org/freedesktop/compiz/annotate/screen%d/clear_key", DefaultScreen(dpy)); + + draw_proxy = dbus_g_proxy_new_for_name(bus, ofc, draw, ofc); + clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, clear, ofc); } void Annotate::draw(Point p, Point q) { @@ -14,6 +14,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fire.h" +#include <X11/Xlib.h> #include <math.h> Fire::Fire() { @@ -24,8 +25,13 @@ Fire::Fire() { g_error_free(error); throw DBusException(); } - point_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/firepaint/allscreens/add_particle", ofc); - clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/firepaint/allscreens/clear_key", ofc); + char add[256]; + char clear[256]; + snprintf(add, sizeof(add), "/org/freedesktop/compiz/firepaint/screen%d/add_particle", DefaultScreen(dpy)); + snprintf(clear, sizeof(clear), "/org/freedesktop/compiz/firepaint/screen%d/clear_key", DefaultScreen(dpy)); + + point_proxy = dbus_g_proxy_new_for_name(bus, ofc, add, ofc); + clear_proxy = dbus_g_proxy_new_for_name(bus, ofc, clear, ofc); } void Fire::add_point(float x, float y) { @@ -14,6 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "water.h" +#include <X11/Xlib.h> +#include <stdio.h> Water::Water() { const char *ofc = "org.freedesktop.compiz"; @@ -23,7 +25,9 @@ Water::Water() { g_error_free(error); throw DBusException(); } - line_proxy = dbus_g_proxy_new_for_name(bus, ofc, "/org/freedesktop/compiz/water/allscreens/line", ofc); + char line[256]; + snprintf(line, sizeof(line), "/org/freedesktop/compiz/water/screen%d/line", DefaultScreen(dpy)); + line_proxy = dbus_g_proxy_new_for_name(bus, ofc, line, ofc); } void Water::draw(Point p, Point q) {