summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--platform/gl/gl-annotate.c8
-rw-r--r--platform/gl/gl-main.c15
2 files changed, 16 insertions, 7 deletions
diff --git a/platform/gl/gl-annotate.c b/platform/gl/gl-annotate.c
index 9acf7746..92458824 100644
--- a/platform/gl/gl-annotate.c
+++ b/platform/gl/gl-annotate.c
@@ -357,7 +357,7 @@ static void do_annotate_contents(void)
pdf_set_annot_contents(ctx, selected_annot, input.text);
}
-static void do_widget_value()
+static void do_widget_value(void)
{
int ff, type;
char *value;
@@ -380,7 +380,8 @@ static void do_widget_value()
if (ui_input(&input, 0, (ff & Ff_Multiline) ? 5 : 1) >= UI_INPUT_EDIT)
{
pdf_field_set_value(ctx, selected_annot->page->doc, selected_annot->obj, input.text);
- pdf_dirty_annot(ctx, selected_annot);
+ if (pdf_update_page(ctx, selected_annot->page))
+ render_page();
}
}
else if (type == PDF_WIDGET_TYPE_COMBOBOX || type == PDF_WIDGET_TYPE_LISTBOX)
@@ -396,7 +397,8 @@ static void do_widget_value()
if (choice >= 0)
{
pdf_field_set_value(ctx, selected_annot->page->doc, selected_annot->obj, options[choice]);
- pdf_dirty_annot(ctx, selected_annot);
+ if (pdf_update_page(ctx, selected_annot->page))
+ render_page();
}
fz_free(ctx, value);
fz_free(ctx, options);
diff --git a/platform/gl/gl-main.c b/platform/gl/gl-main.c
index ee182cdd..899dc4ec 100644
--- a/platform/gl/gl-main.c
+++ b/platform/gl/gl-main.c
@@ -266,6 +266,13 @@ void render_page(void)
fz_gamma_pixmap(ctx, pix, 1 / 1.4f);
}
+ if (pdf)
+ {
+ pdf_annot *annot;
+ for (annot = page->annots; annot; annot = annot->next)
+ annot->has_new_ap = 0;
+ }
+
ui_texture_from_pixmap(&page_tex, pix);
fz_drop_pixmap(ctx, pix);
}
@@ -573,8 +580,8 @@ static void do_forms(void)
{
if (pdf->focus)
ui.active = &do_forms_tag;
- pdf_update_page(ctx, (pdf_page*)page);
- render_page();
+ if (pdf_update_page(ctx, page))
+ render_page();
}
}
else if (ui.active == &do_forms_tag && !ui.down)
@@ -585,8 +592,8 @@ static void do_forms(void)
event.event.pointer.ptype = PDF_POINTER_UP;
if (pdf_pass_event(ctx, pdf, (pdf_page*)page, &event))
{
- pdf_update_page(ctx, (pdf_page*)page);
- render_page();
+ if (pdf_update_page(ctx, page))
+ render_page();
}
}
}