[Commits] [SCM] claws branch, litehtml, updated. 3.17.3-116-g11f46ee

ticho at claws-mail.org ticho at claws-mail.org
Tue Feb 12 00:34:42 CET 2019


The branch, litehtml has been updated
       via  11f46eefd21d018f5854f1ec698eacd20e6dea92 (commit)
      from  f372dd18a61433c83def6188180b5e3666d6797e (commit)

Summary of changes:
 src/plugins/litehtml_viewer/lh_widget.cpp |   21 +++------------------
 src/plugins/litehtml_viewer/lh_widget.h   |    2 --
 2 files changed, 3 insertions(+), 20 deletions(-)


- Log -----------------------------------------------------------------
commit 11f46eefd21d018f5854f1ec698eacd20e6dea92
Author: Andrej Kacian <ticho at claws-mail.org>
Date:   Tue Feb 12 00:32:44 2019 +0100

    Use height of the viewport, not the scrolled window when telling Litehtml size of the area it has available for rendering

diff --git a/src/plugins/litehtml_viewer/lh_widget.cpp b/src/plugins/litehtml_viewer/lh_widget.cpp
index df6ee99..bf047cf 100644
--- a/src/plugins/litehtml_viewer/lh_widget.cpp
+++ b/src/plugins/litehtml_viewer/lh_widget.cpp
@@ -50,8 +50,6 @@ char master_css[] = {
 
 static gboolean expose_event_cb(GtkWidget *widget, GdkEvent *event,
 		gpointer user_data);
-static void size_allocate_cb(GtkWidget *widget, GdkRectangle *allocation,
-		gpointer user_data);
 static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
 		gpointer user_data);
 static gboolean motion_notify_event(GtkWidget *widget, GdkEventButton *event,
@@ -69,8 +67,6 @@ lh_widget::lh_widget()
 	m_scrolled_window = gtk_scrolled_window_new(NULL, NULL);
 	gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(m_scrolled_window),
 			GTK_POLICY_AUTOMATIC, GTK_POLICY_ALWAYS);
-	g_signal_connect(m_scrolled_window, "size-allocate",
-			G_CALLBACK(size_allocate_cb), this);
 
 	/* viewport */
 	GtkScrolledWindow *scw = GTK_SCROLLED_WINDOW(m_scrolled_window);
@@ -263,7 +259,7 @@ void lh_widget::draw(cairo_t *cr)
 void lh_widget::redraw()
 {
 	GtkAllocation rect;
-	gint width, height;
+	gint width;
 	GdkWindow *gdkwin;
 	cairo_t *cr;
 
@@ -274,7 +270,8 @@ void lh_widget::redraw()
 
 	/* Get width of the viewport. */
 	gdkwin = gtk_viewport_get_view_window(GTK_VIEWPORT(m_viewport));
-	gdk_drawable_get_size(gdkwin, &width, NULL);
+	width = gdk_window_get_width(gdkwin);
+	m_height = gdk_window_get_height(gdkwin);
 
 	/* If the available width has changed, rerender the HTML content. */
 	if (m_rendered_width != width) {
@@ -432,18 +429,6 @@ static gboolean expose_event_cb(GtkWidget *widget, GdkEvent *event,
 	return FALSE;
 }
 
-static void size_allocate_cb(GtkWidget *widget, GdkRectangle *allocation,
-		gpointer user_data)
-{
-	lh_widget *w = (lh_widget *)user_data;
-
-	debug_print("size_allocate_cb: %dx%d\n",
-			allocation->width, allocation->height);
-
-	w->setHeight(allocation->height);
-	w->redraw();
-}
-
 static gboolean button_press_event(GtkWidget *widget, GdkEventButton *event,
 		gpointer user_data)
 {
diff --git a/src/plugins/litehtml_viewer/lh_widget.h b/src/plugins/litehtml_viewer/lh_widget.h
index f4060d5..5e2a872 100644
--- a/src/plugins/litehtml_viewer/lh_widget.h
+++ b/src/plugins/litehtml_viewer/lh_widget.h
@@ -20,8 +20,6 @@ class lh_widget : public container_linux
 		void get_client_rect(litehtml::position& client) const;
 		GdkPixbuf *get_image(const litehtml::tchar_t* url, bool redraw_on_ready);
 
-		gint height() const { return m_height; };
-		void setHeight(gint height) { m_height = height; };
 		void draw(cairo_t *cr);
 		void redraw();
 		void open_html(const gchar *contents);

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


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list