summaryrefslogtreecommitdiff
path: root/plugins/xrandr
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-10-11 17:04:03 +0300
committermonsta <[email protected]>2016-10-11 17:04:03 +0300
commitfa25c2b0a6449906a0451be1a97e170f069d6ca4 (patch)
tree9c2fd5e557993c20965aeaf2dd5095f83adb8a2a /plugins/xrandr
parente8ef64899caca8b6594ceecfee4e4ecf410ed27e (diff)
downloadmate-settings-daemon-fa25c2b0a6449906a0451be1a97e170f069d6ca4.tar.bz2
mate-settings-daemon-fa25c2b0a6449906a0451be1a97e170f069d6ca4.tar.xz
xrandr: use proper libmate-desktop function in GTK+3 build
or it will break the plugin once libmate-desktop becomes GTK+3 only
Diffstat (limited to 'plugins/xrandr')
-rw-r--r--plugins/xrandr/msd-xrandr-manager.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins/xrandr/msd-xrandr-manager.c b/plugins/xrandr/msd-xrandr-manager.c
index c8eafce..31d90e1 100644
--- a/plugins/xrandr/msd-xrandr-manager.c
+++ b/plugins/xrandr/msd-xrandr-manager.c
@@ -1688,8 +1688,10 @@ output_title_label_expose_event_cb (GtkWidget *widget, GdkEventExpose *event, gp
MsdXrandrManager *manager = MSD_XRANDR_MANAGER (data);
struct MsdXrandrManagerPrivate *priv = manager->priv;
MateRROutputInfo *output;
+#if GTK_CHECK_VERSION (3, 0, 0)
+ GdkRGBA color;
+#else
GdkColor color;
-#if !GTK_CHECK_VERSION (3, 0, 0)
cairo_t *cr;
#endif
GtkAllocation allocation;
@@ -1702,10 +1704,10 @@ output_title_label_expose_event_cb (GtkWidget *widget, GdkEventExpose *event, gp
g_assert (priv->labeler != NULL);
/* Draw a black rectangular border, filled with the color that corresponds to this output */
-
+#if GTK_CHECK_VERSION (3, 0, 0)
+ mate_rr_labeler_get_rgba_for_output (priv->labeler, output, &color);
+#else
mate_rr_labeler_get_color_for_output (priv->labeler, output, &color);
-
-#if !GTK_CHECK_VERSION (3, 0, 0)
cr = gdk_cairo_create (gtk_widget_get_window (widget));
#endif
@@ -1719,7 +1721,11 @@ output_title_label_expose_event_cb (GtkWidget *widget, GdkEventExpose *event, gp
allocation.height - OUTPUT_TITLE_ITEM_BORDER);
cairo_stroke (cr);
+#if GTK_CHECK_VERSION (3, 0, 0)
+ gdk_cairo_set_source_rgba (cr, &color);
+#else
gdk_cairo_set_source_color (cr, &color);
+#endif
cairo_rectangle (cr,
allocation.x + OUTPUT_TITLE_ITEM_BORDER,
allocation.y + OUTPUT_TITLE_ITEM_BORDER,