[Commits] [SCM] claws branch, master, updated. 4.1.1-75-g7f2cc1b35

mones at claws-mail.org mones at claws-mail.org
Tue Aug 22 17:02:51 UTC 2023


The branch, master has been updated
       via  7f2cc1b35642b2bae5c2d1c7e08ffaed57be18d2 (commit)
      from  d832b62d7b4044e00ea5c3d035f18d2a05289301 (commit)

Summary of changes:
 src/stock_pixmap.c | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)


- Log -----------------------------------------------------------------
commit 7f2cc1b35642b2bae5c2d1c7e08ffaed57be18d2
Author: Ricardo Mones <ricardo at mones.org>
Date:   Fri Mar 25 21:04:56 2022 +0100

    Fix three warnings in do_pix_draw()
    
    stock_pixmap.c:971:4: warning: ‘gtk_widget_get_style’ is deprecated: Use 'gtk_widget_get_style_context' instead [-Wdeprecated-declarations]
    stock_pixmap.c:973:4: warning: ‘gdk_cairo_create’ is deprecated: Use 'gdk_window_begin_draw_frame() and gdk_drawing_context_get_cairo_context()' instead [-Wdeprecated-declarations]
    stock_pixmap.c:974:4: warning: ‘gdk_cairo_set_source_color’ is deprecated: Use 'gdk_cairo_set_source_rgba' instead [-Wdeprecated-declarations]

diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
index 44dcdb72d..99303ffc3 100644
--- a/src/stock_pixmap.c
+++ b/src/stock_pixmap.c
@@ -949,10 +949,14 @@ static gboolean do_pix_draw(GtkWidget *widget, cairo_t *cr,
 		mw = mainwindow_get_mainwindow();
 		if (mw != NULL && mw->menubar != NULL) {
 			cairo_t *cr;
-			GdkColor color = gtk_widget_get_style(mw->menubar)->base[GTK_STATE_SELECTED];
-
-			cr = gdk_cairo_create(drawable);
-			gdk_cairo_set_source_color(cr, &color);
+			GdkRGBA color;
+
+			GtkStyleContext *context = gtk_widget_get_style_context (mw->menubar);
+			gtk_style_context_lookup_color (context, "selected_bg_color", &color);
+			cairo_region_t * creg = cairo_region_create();
+			GdkDrawingContext * dctx  = gdk_window_begin_draw_frame (drawable, creg);
+			cr = gdk_drawing_context_get_cairo_context (dctx);
+			gdk_cairo_set_source_rgba (cr, &color);
 			cairo_set_antialias(cr, CAIRO_ANTIALIAS_NONE);
 			cairo_set_line_width(cr, 1.);
 			cairo_set_line_cap(cr, CAIRO_LINE_CAP_BUTT);
@@ -960,7 +964,8 @@ static gboolean do_pix_draw(GtkWidget *widget, cairo_t *cr,
 			cairo_rectangle(cr, data->border_x-2, data->border_y-2,
 			    data->base_width+3, data->base_height+3);
 			cairo_stroke(cr);
-			cairo_destroy(cr);
+			gdk_window_end_draw_frame (drawable, dctx);
+			cairo_region_destroy (creg);
 		}
 	}
 

-----------------------------------------------------------------------


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list