Fix GTK3-related compile errors for litehtml plugin
authorAndrej Kacian <ticho@claws-mail.org>
Sat, 4 May 2019 15:17:39 +0000 (17:17 +0200)
committerAndrej Kacian <ticho@claws-mail.org>
Sat, 4 May 2019 15:17:39 +0000 (17:17 +0200)
src/plugins/litehtml_viewer/lh_prefs.c
src/plugins/litehtml_viewer/lh_widget.cpp
src/stock_pixmap.c

index c43abbd7b52947fc27f8b3dc2acda6fda88c6556..8768ff44fa146b6220b09b7984b8fd879014c8aa 100644 (file)
@@ -104,7 +104,7 @@ static void create_lh_prefs_page(PrefsPage *page, GtkWindow *window,
        GtkWidget *enable_remote_content;
        GtkWidget *image_cache_size;
        GtkWidget *default_font;
-       GtkObject *adj;
+       GtkAdjustment *adj;
 
        vbox = gtk_vbox_new(FALSE, 3);
        gtk_container_set_border_width(GTK_CONTAINER(vbox), VBOX_BORDER);
index 7f87b0d4def194fa92611d106b0ff9498cc00368..71518ed23bc5994170e1a0ded346e19fe75515be 100644 (file)
@@ -261,7 +261,7 @@ void lh_widget::redraw(gboolean force_render)
                g_warning("lh_widget::redraw: No GdkWindow to draw on!");
                return;
        }
-       cr = gdk_cairo_create(GDK_DRAWABLE(gdkwin));
+       cr = gdk_cairo_create(gdkwin);
        draw(cr);
 
        cairo_destroy(cr);
@@ -274,12 +274,15 @@ void lh_widget::paint_white()
                g_warning("lh_widget::clear: No GdkWindow to draw on!");
                return;
        }
-       cairo_t *cr = gdk_cairo_create(GDK_DRAWABLE(gdkwin));
+       cairo_t *cr = gdk_cairo_create(gdkwin);
 
        /* Paint white background. */
        gint width, height;
-       gdk_drawable_get_size(gdkwin, &width, &height);
-       cairo_rectangle(cr, 0, 0, width, height);
+       width = gdk_window_get_width(gdkwin);
+       height = gdk_window_get_height(gdkwin);
+       cairo_rectangle(cr, 0, 0,
+                       gdk_window_get_width(gdkwin),
+                       gdk_window_get_height(gdkwin));
        cairo_set_source_rgb(cr, 255, 255, 255);
        cairo_fill(cr);
 
index 67cd3c35e50eaeac18f96a3c48291872f6170238..c8e702d75d176b2bc182728b1933bfe6a1ec6ec3 100644 (file)
@@ -1029,13 +1029,15 @@ GtkWidget *stock_pixmap_widget_with_overlay(StockPixmap icon,
 
        if (pos != OVERLAY_NONE) {
                stock_wid = stock_pixmap_widget(overlay);
+               g_object_ref_sink(stock_wid);
+
                stock_pixbuf = gtk_image_get_pixbuf(GTK_IMAGE(stock_wid));
                g_object_ref(stock_pixbuf);
                data->overlay_pixbuf = stock_pixbuf;
                data->overlay_height = height;
                data->overlay_width  = width;
 
-               gtk_widget_destroy(stock_wid);
+               g_object_unref(stock_wid);
        }
 
        data->position = pos;