diff options
author | monsta <[email protected]> | 2016-01-10 19:13:01 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-01-10 19:24:39 +0300 |
commit | 0f7314ea3db7411ae7827ec9bb89a2b485227f1a (patch) | |
tree | dc2c8743f6094da0483d013eaa07982b13d4fbef | |
parent | d06b2095e4fd8d3ecc231ce523a76a60b34a77db (diff) | |
download | mate-panel-0f7314ea3db7411ae7827ec9bb89a2b485227f1a.tar.bz2 mate-panel-0f7314ea3db7411ae7827ec9bb89a2b485227f1a.tar.xz |
background: reduce number of #if's once more
-rw-r--r-- | mate-panel/panel-background.c | 31 |
1 files changed, 15 insertions, 16 deletions
diff --git a/mate-panel/panel-background.c b/mate-panel/panel-background.c index 4c46ea8f..8e3131ad 100644 --- a/mate-panel/panel-background.c +++ b/mate-panel/panel-background.c @@ -1307,23 +1307,15 @@ panel_background_make_string (PanelBackground *background, effective_type = panel_background_effective_type (background); +#if GTK_CHECK_VERSION (3, 0, 0) if (effective_type == PANEL_BACK_IMAGE || (effective_type == PANEL_BACK_COLOR && background->has_alpha -#if GTK_CHECK_VERSION (3, 0, 0) && (!gdk_window_check_composited_wm(background->window)))) { cairo_surface_t *surface; if (!background->composited_pattern) return NULL; -#else - )) { - GdkNativeWindow pixmap_xid; - - if (!background->pixmap) - return NULL; -#endif -#if GTK_CHECK_VERSION (3, 0, 0) if (cairo_pattern_get_surface (background->composited_pattern, &surface) != CAIRO_STATUS_SUCCESS) return NULL; @@ -1331,27 +1323,34 @@ panel_background_make_string (PanelBackground *background, return NULL; retval = g_strdup_printf ("pixmap:%d,%d,%d", (guint32)cairo_xlib_surface_get_drawable (surface), x, y); -#else - pixmap_xid = GDK_WINDOW_XID (GDK_DRAWABLE (background->pixmap)); - - retval = g_strdup_printf ("pixmap:%d,%d,%d", pixmap_xid, x, y); -#endif } else if (effective_type == PANEL_BACK_COLOR) { -#if GTK_CHECK_VERSION (3, 0, 0) gchar *rgba = gdk_rgba_to_string (&background->color); retval = g_strdup_printf ( "color:%s", rgba); g_free (rgba); + } else + retval = g_strdup ("none:"); #else + if (effective_type == PANEL_BACK_IMAGE || + (effective_type == PANEL_BACK_COLOR && background->has_alpha)) { + GdkNativeWindow pixmap_xid; + + if (!background->pixmap) + return NULL; + + pixmap_xid = GDK_WINDOW_XID (GDK_DRAWABLE (background->pixmap)); + + retval = g_strdup_printf ("pixmap:%d,%d,%d", pixmap_xid, x, y); + } else if (effective_type == PANEL_BACK_COLOR) { retval = g_strdup_printf ( "color:%.4x%.4x%.4x", background->color.gdk.red, background->color.gdk.green, background->color.gdk.blue); -#endif } else retval = g_strdup ("none:"); +#endif return retval; } |