commit 6e3ba6de4bffb9fb39db7e1b32dd8081cc31a15e
parent 3d290a4f13ebd849b25890bf62bea7e38a8ce618
Author: Andrej Kacian <ticho@claws-mail.org>
Date: Sat, 4 May 2019 17:17:39 +0200
Fix GTK3-related compile errors for litehtml plugin
Diffstat:
3 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/src/plugins/litehtml_viewer/lh_prefs.c b/src/plugins/litehtml_viewer/lh_prefs.c
@@ -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);
diff --git a/src/plugins/litehtml_viewer/lh_widget.cpp b/src/plugins/litehtml_viewer/lh_widget.cpp
@@ -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);
diff --git a/src/stock_pixmap.c b/src/stock_pixmap.c
@@ -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;