From 89d59a6559c8ae0a05fadeab95adf9fd988c016a Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Fri, 11 Dec 2020 16:44:57 +0000 Subject: fixup pdf content handler for modified interfaces --- content/handlers/pdf/pdf.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/content/handlers/pdf/pdf.c b/content/handlers/pdf/pdf.c index a39819249..bc8a365f3 100644 --- a/content/handlers/pdf/pdf.c +++ b/content/handlers/pdf/pdf.c @@ -37,7 +37,9 @@ #include "netsurf/content.h" #include "netsurf/browser_window.h" #include "content/llcache.h" +#include "content/content.h" #include "content/content_protected.h" +#include "content/content_factory.h" #include "pdf.h" @@ -243,6 +245,7 @@ pdf_change_page(struct pdf_content *pdfc, float page_width; float page_height; nspdferror pdfres; + union content_msg_data msgdata; /* ensure page stays in bounds */ if (page_number >= pdfc->page_count) { @@ -265,10 +268,15 @@ pdf_change_page(struct pdf_content *pdfc, page_height); } - browser_window_update(bw, false); + msgdata.redraw.x = 0; + msgdata.redraw.y = 0; + msgdata.redraw.width = pdfc->base.width; + msgdata.redraw.height = pdfc->base.height; + + content_broadcast(&pdfc->base, CONTENT_MSG_REDRAW, &msgdata); } -static void +static nserror pdf_mouse_action(struct content *c, struct browser_window *bw, browser_mouse_state mouse, @@ -287,6 +295,7 @@ pdf_mouse_action(struct content *c, pdf_change_page(pdfc, bw, pdfc->current_page + 1); } } + return NSERROR_OK; } static const content_handler nspdf_content_handler = { -- cgit v1.2.3