From 448750ef63b8806323a4f4a9ed79e126cab206d6 Mon Sep 17 00:00:00 2001 From: lukefromdc Date: Thu, 24 Mar 2016 23:36:34 -0400 Subject: Gtk3.18/3.20-move background handling toplevel panel-applet-frame.c --- mate-panel/panel-applet-frame.c | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) (limited to 'mate-panel') diff --git a/mate-panel/panel-applet-frame.c b/mate-panel/panel-applet-frame.c index 2abe5914..ddd28906 100644 --- a/mate-panel/panel-applet-frame.c +++ b/mate-panel/panel-applet-frame.c @@ -123,8 +123,12 @@ mate_panel_applet_frame_draw (GtkWidget *widget, gtk_style_context_get (context, state, "background-image", &bg_pattern, NULL); - background = &frame->priv->panel->background; +#if GTK_CHECK_VERSION (3, 18, 0) + background = &frame->priv->panel->toplevel->background; +#else + background = &frame->priv->panel->background; +#endif if (bg_pattern && (background->type == PANEL_BACK_IMAGE || (background->type == PANEL_BACK_COLOR && background->has_alpha))) { cairo_matrix_t ptm; @@ -223,9 +227,11 @@ mate_panel_applet_frame_update_background_size (MatePanelAppletFrame *frame, old_allocation->width == new_allocation->width && old_allocation->height == new_allocation->height) return; - +#if GTK_CHECK_VERSION (3, 18, 0) + background = &frame->priv->panel->toplevel->background; +#else background = &frame->priv->panel->background; - +#endif if (background->type == PANEL_BACK_NONE || (background->type == PANEL_BACK_COLOR && !background->has_alpha)) return; @@ -647,8 +653,11 @@ mate_panel_applet_frame_change_background (MatePanelAppletFrame *frame, if (frame->priv->has_handle) { PanelBackground *background; - +#if GTK_CHECK_VERSION (3, 18, 0) + background = &PANEL_WIDGET (parent)->toplevel->background; +#else background = &PANEL_WIDGET (parent)->background; +#endif #if GTK_CHECK_VERSION (3, 0, 0) panel_background_apply_css (background, GTK_WIDGET (frame)); #else @@ -744,7 +753,11 @@ _mate_panel_applet_frame_update_flags (MatePanelAppletFrame *frame, * it */ PanelBackground *background; +#if GTK_CHECK_VERSION (3, 18, 0) + background = &frame->priv->panel->toplevel->background; +#else background = &frame->priv->panel->background; +#endif mate_panel_applet_frame_change_background (frame, background->type); } } @@ -800,8 +813,11 @@ _mate_panel_applet_frame_get_background_string (MatePanelAppletFrame *frame, break; } } - +#if GTK_CHECK_VERSION (3, 18, 0) + return panel_background_make_string (&panel->toplevel->background, x, y); +#else return panel_background_make_string (&panel->background, x, y); +#endif } static void -- cgit v1.2.1