diff options
author | zhuyaliang <[email protected]> | 2023-10-10 11:41:27 +0800 |
---|---|---|
committer | raveit65 <[email protected]> | 2023-10-17 19:10:05 +0200 |
commit | f27d27edf0b97f292a8b6b93fe262fd9b5a4ff2a (patch) | |
tree | 03bc19e5c8a1b1c76d0cbb099de1ed87cd402f22 /typing-break/drw-utils.c | |
parent | 4bd1a51c9a5d0d5e2f570a21d12b521e68cc4ffd (diff) | |
download | mate-control-center-f27d27edf0b97f292a8b6b93fe262fd9b5a4ff2a.tar.bz2 mate-control-center-f27d27edf0b97f292a8b6b93fe262fd9b5a4ff2a.tar.xz |
typing-break: Fix compilation warnings and replace deprecated functions
Diffstat (limited to 'typing-break/drw-utils.c')
-rw-r--r-- | typing-break/drw-utils.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/typing-break/drw-utils.c b/typing-break/drw-utils.c index c3f754c1..c70806a5 100644 --- a/typing-break/drw-utils.c +++ b/typing-break/drw-utils.c @@ -115,12 +115,14 @@ window_draw_event (GtkWidget *widget, static void set_pixmap_background (GtkWidget *window) { - GdkScreen *screen; - GdkPixbuf *tmp_pixbuf, *pixbuf, *tile_pixbuf; - GdkRectangle rect; - GdkColor color; - gint width, height, scale; - cairo_t *cr; + GdkScreen *screen; + GdkPixbuf *tmp_pixbuf, *pixbuf, *tile_pixbuf; + GdkRectangle rect; + GdkColor color; + gint width, height, scale; + cairo_t *cr; + cairo_region_t *cairo_region; + GdkDrawingContext *gdc; gtk_widget_realize (window); @@ -168,13 +170,15 @@ set_pixmap_background (GtkWidget *window) g_object_unref (tile_pixbuf); - cr = gdk_cairo_create (gtk_widget_get_window (window)); + cairo_region = cairo_region_create (); + gdc = gdk_window_begin_draw_frame (gtk_widget_get_window (window), cairo_region); + cr = gdk_drawing_context_get_cairo_context (gdc); gdk_cairo_set_source_pixbuf (cr, tmp_pixbuf, 0, 0); cairo_paint (cr); g_object_unref (tmp_pixbuf); - - cairo_destroy (cr); + gdk_window_end_draw_frame (gtk_widget_get_window (window), gdc); + cairo_region_destroy (cairo_region); } void |