From 933682619f5b34307dbe7b3872d19bb90876423c Mon Sep 17 00:00:00 2001 From: Marko Lindqvist Date: Fri, 4 Mar 2022 19:29:47 +0200 Subject: [PATCH 46/46] gtk4: Implement dirty_all() Also call dirty_all() from dirty_rect() so that view gets redrawn when ever there's need for it. See osdn #44025 Signed-off-by: Marko Lindqvist --- client/gui-gtk-4.0/mapview.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/client/gui-gtk-4.0/mapview.c b/client/gui-gtk-4.0/mapview.c index 0f60e6437f..10ae7d0190 100644 --- a/client/gui-gtk-4.0/mapview.c +++ b/client/gui-gtk-4.0/mapview.c @@ -418,13 +418,7 @@ void map_canvas_draw(GtkDrawingArea *w, cairo_t *cr, void dirty_rect(int canvas_x, int canvas_y, int pixel_width, int pixel_height) { - // GdkRectangle rectangle = {canvas_x, canvas_y, pixel_width, pixel_height}; - - if (gtk_widget_get_realized(map_canvas)) { - // GtkNative *nat = gtk_widget_get_native(map_canvas); - - // gdk_surface_invalidate_rect(gtk_native_get_surface(nat), &rectangle); - } + dirty_all(); } /**********************************************************************//** @@ -433,9 +427,7 @@ void dirty_rect(int canvas_x, int canvas_y, void dirty_all(void) { if (gtk_widget_get_realized(map_canvas)) { - // GtkNative *nat = gtk_widget_get_native(map_canvas); - - // gdk_surface_invalidate_rect(gtk_native_get_surface(nat), NULL); + gtk_widget_queue_draw(map_canvas); } } -- 2.34.1