wdvi

network DVI viewer
Log | Files | Refs

commit dc8e8ec7fd1b3bea753db787e93534794c551e4b
parent c4f4abff8c837c023b01c2b2402ff35f96bed5bf
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Thu,  9 Sep 2021 00:43:53 +0000

remove popup postponing

A known good default document will be loaded first, so we can
guarantee it will not make popups.

Diffstat:
Mdvi-init.c | 19-------------------
Mpopups.c | 16+---------------
Mxdvi.c | 12------------
Mxdvi.h | 12------------
4 files changed, 1 insertion(+), 58 deletions(-)

diff --git a/dvi-init.c b/dvi-init.c @@ -776,8 +776,6 @@ init_dvi_file() (void) internal_init_dvi(); } -static Widget dvi_popup = NULL; /* warning popup for corrupt dvi file */ - /** ** Check for changes in dvi file. Return True if it's OK. **/ @@ -806,23 +804,6 @@ reload_dvi_file() page_info = NULL; full_reset_colors(); } - if (dvi_popup != NULL) { - int i; - - for (i = 0;; ++i) { - if (i >= n_init_popups) { - XtDestroyWidget(dvi_popup); - break; - } - if (XtParent(init_popups[i]) == dvi_popup) { - while (++i < n_init_popups) - init_popups[i - 1] = init_popups[i]; - --n_init_popups; - break; - } - } - dvi_popup = NULL; - } bzero((char *) tn_table, (int) sizeof(tn_table)); free_vf_chain(tn_head); tn_head = NULL; diff --git a/popups.c b/popups.c @@ -371,21 +371,7 @@ warning_popup(message, button_name, callback) } XdviXawRealizePopup(shell, callback != NULL ? callback : warn_callback); - - if (postpone_popups) { - /* save it for later */ - if (n_init_popups >= alloc_init_popups) { - if (alloc_init_popups != 0) - init_popups = xrealloc(init_popups, - (alloc_init_popups += 2) * sizeof (*init_popups)); - else - init_popups = xmalloc((alloc_init_popups = 2) - * sizeof (*init_popups)); - } - init_popups[n_init_popups++] = shell; - } - else - do_popup(shell); + do_popup(shell); return shell; } diff --git a/xdvi.c b/xdvi.c @@ -83,7 +83,6 @@ NOTE: #include "dvi-draw.h" /* prescan() */ #include "events.h" /* enable_intr(), compile_action(), ... */ #include "font-open.h" -#include "popups.h" /* do_popup() */ #include "special.h" /* page_info */ #include "util.h" /* xmalloc(), memicmp() */ #include "version.h" @@ -1060,14 +1059,12 @@ or invalid argument:\n\t\"%s\", \"%s\".", enable_intr(); if (dvi_name == NULL) { - postpone_popups = False; dvi_file = fopen("default.dvi", "r"); //act_addr_go(NULL, NULL, NULL, 0); dvi_name = "resume.dvi"; ev_flags |= EV_NEWDOC; (void) read_events(EV_GE_NEWDOC); ev_flags &= ~EV_NEWDOC; - postpone_popups = True; } if (resource.mfmode != NULL) { @@ -1341,15 +1338,6 @@ argument is to override any papersize specials in the dvi file.\n\n", stderr); currwin.win = mane.win = XtWindow(draw_widget); - postpone_popups = False; - if (n_init_popups != 0) { - for (i = 0; i < n_init_popups; ++i) - do_popup(init_popups[i]); - free(init_popups); - init_popups = NULL; - n_init_popups = 0; - } - { XWindowAttributes attrs; diff --git a/xdvi.h b/xdvi.h @@ -305,18 +305,6 @@ Widget top_level = 0; Widget vport_widget, draw_widget, clip_widget; Widget addr_widget, form_widget; -/* - * If a popup is popped up before the main window, then the main window is - * likely to cover it. So we have to postpone popping them up until after - * realizing the main window. It is not workable to pop them up immediately - * and then raise them later, due to unpredictable window manager behavior. - */ - -Boolean postpone_popups = True; -size_t n_init_popups = 0; -Widget *init_popups; -size_t alloc_init_popups = 0; - char *ffline = NULL; /* an array used by filefind to store */ /* the file name being formed. */ /* It expands as needed. */