summaryrefslogtreecommitdiff
path: root/capplets/display/xrandr-capplet.c
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2014-01-24 16:18:01 +0100
committerStefano Karapetsas <[email protected]>2014-01-24 16:18:01 +0100
commitc0d97d196ab43b214648dde0af05bd1b40033fce (patch)
treebe6641e90cc43858d613ba3f14ed6aa4397d531c /capplets/display/xrandr-capplet.c
parent68341c156377131681ef80af1c9201f212bbd96c (diff)
downloadmate-control-center-c0d97d196ab43b214648dde0af05bd1b40033fce.tar.bz2
mate-control-center-c0d97d196ab43b214648dde0af05bd1b40033fce.tar.xz
display: Add GTK3 support
Diffstat (limited to 'capplets/display/xrandr-capplet.c')
-rw-r--r--capplets/display/xrandr-capplet.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/capplets/display/xrandr-capplet.c b/capplets/display/xrandr-capplet.c
index d5d4f83c..7a2325c5 100644
--- a/capplets/display/xrandr-capplet.c
+++ b/capplets/display/xrandr-capplet.c
@@ -37,6 +37,10 @@
#include <dbus/dbus-glib.h>
#include <dbus/dbus-glib-bindings.h>
+#if GTK_CHECK_VERSION (3, 0, 0)
+#define GdkRegion cairo_region_t
+#endif
+
typedef struct App App;
typedef struct GrabInfo GrabInfo;
@@ -1486,7 +1490,11 @@ set_cursor (GtkWidget *widget, GdkCursorType type)
gdk_window_set_cursor (window, cursor);
if (cursor)
+#if GTK_CHECK_VERSION (3, 0, 0)
+ g_object_unref (cursor);
+#else
gdk_cursor_unref (cursor);
+#endif
}
static void
@@ -2205,7 +2213,11 @@ get_output_for_window (MateRRConfig *configuration, GdkWindow *window)
int largest_area;
int largest_index;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height);
+#else
gdk_window_get_geometry (window, &win_rect.x, &win_rect.y, &win_rect.width, &win_rect.height, NULL);
+#endif
gdk_window_get_origin (window, &win_rect.x, &win_rect.y);
largest_area = 0;