From 8e0f187fc64078977ed896ddad0c3f15ab822dc7 Mon Sep 17 00:00:00 2001 From: Thomas Jaeger Date: Wed, 10 Aug 2011 14:18:32 -0400 Subject: [PATCH] Account for dbus api change in compiz 0.9 --- annotate.cc | 12 ++++++++++-- fire.cc | 10 ++++++++-- water.cc | 6 +++++- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/annotate.cc b/annotate.cc index 4bab714f..a6f04817 100644 --- a/annotate.cc +++ b/annotate.cc @@ -14,6 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "annotate.h" +#include +#include 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) { diff --git a/fire.cc b/fire.cc index 8a15b63b..729cf9f3 100644 --- a/fire.cc +++ b/fire.cc @@ -14,6 +14,7 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "fire.h" +#include #include 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) { diff --git a/water.cc b/water.cc index abe21cd4..a528b01c 100644 --- a/water.cc +++ b/water.cc @@ -14,6 +14,8 @@ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include "water.h" +#include +#include 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) {