From d4d9fa230deb01442aaa04e55ad461e4543d0277 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Lars=20Gullik=20Bj=C3=B8nnes?= Date: Sat, 4 Aug 2001 10:26:01 +0000 Subject: [PATCH] make sure the Xserver updates the input git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2419 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/LaTeX.C | 23 ++++++++++++++--------- src/minibuffer.C | 41 +++++++++++++++++++++++++---------------- src/minibuffer.h | 2 ++ 4 files changed, 45 insertions(+), 25 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index 945e7af411..9c638823d9 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-08-04 Lars Gullik Bjønnes + + * minibuffer.C: make sure the X server sees the changes in the input. + 2001-08-03 Lars Gullik Bjønnes * paragraph.C (getFont): split into... diff --git a/src/LaTeX.C b/src/LaTeX.C index c4ce8c3398..77598bf9f6 100644 --- a/src/LaTeX.C +++ b/src/LaTeX.C @@ -213,8 +213,10 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) { // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; - if (lfun) lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex.")); -// WriteStatus(minib, _("Running MakeIndex.")); + if (lfun) { + lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex.")); + } + rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx"))); } @@ -226,15 +228,18 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) // tags is found -> run bibtex and set rerun = true; // no checks for now lyxerr[Debug::LATEX] << "Running BibTeX." << endl; - if (lfun) lfun->dispatch(LFUN_MESSAGE, _("Running BibTeX.")); - //WriteStatus(minib, _("Running BibTeX.")); + if (lfun) { + lfun->dispatch(LFUN_MESSAGE, _("Running BibTeX.")); + } + updateBibtexDependencies(head, bibtex_info); rerun |= runBibTeX(bibtex_info); - } else if (!had_depfile) + } else if (!had_depfile) { /// If we run pdflatex on the file after running latex on it, /// then we do not need to run bibtex, but we do need to /// insert the .bib and .bst files into the .dep-pdf file. updateBibtexDependencies(head, bibtex_info); + } // 1 // we know on this point that latex has been run once (or we just @@ -261,8 +266,6 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) lfun->dispatch(LFUN_MESSAGE, str.str().c_str()); } -// WriteStatus(minib, -// string(_("LaTeX run number ")) + tostr(count)); this->operator()(); scanres = scanLogFile(terr); if (scanres & ERRORS) { @@ -289,8 +292,10 @@ int LaTeX::run(TeXErrors & terr, LyXFunc * lfun) if (head.haschanged(OnlyFilename(ChangeExtension(file, ".idx")))) { // no checks for now lyxerr[Debug::LATEX] << "Running MakeIndex." << endl; - if (lfun) lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex.")); - //WriteStatus(minib, _("Running MakeIndex.")); + if (lfun) { + lfun->dispatch(LFUN_MESSAGE, _("Running MakeIndex.")); + } + rerun = runMakeIndex(OnlyFilename(ChangeExtension(file, ".idx"))); } diff --git a/src/minibuffer.C b/src/minibuffer.C index 68614d0910..95ebfe3d4a 100644 --- a/src/minibuffer.C +++ b/src/minibuffer.C @@ -67,7 +67,7 @@ void MiniBuffer::stored_slot() { if (stored_) { stored_ = false; - fl_set_input(the_buffer, stored_input.c_str()); + set_input(stored_input); } } @@ -90,7 +90,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) if (stored_) { stored_timer.stop(); input = stored_input; - fl_set_input(ob, input.c_str()); + set_input(input); stored_ = false; } @@ -102,19 +102,19 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) if (hist_iter == history_->end()) { // no further history stored_set(input); - fl_set_input(ob, _("[End of history]")); + set_input(_("[End of history]")); } else { - fl_set_input(ob, hist_iter->c_str()); + set_input((*hist_iter)); } return 1; case XK_Up: if (hist_iter == history_->begin()) { // no further history stored_set(input); - fl_set_input(ob, _("[Beginning of history]")); + set_input(_("[Beginning of history]")); } else { --hist_iter; - fl_set_input(ob, hist_iter->c_str()); + set_input((*hist_iter)); } return 1; case 9: @@ -131,13 +131,13 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) // No matches string const tmp = input + _(" [no match]"); stored_set(input); - fl_set_input(ob, tmp.c_str()); + set_input(tmp); } else if (comp.size() == 1) { // Perfect match string const tmp = comp[0] + _(" [sole completion]"); stored_set(comp[0]); - fl_set_input(ob, tmp.c_str()); + set_input(tmp); } else { // More that one match // Find maximal avaliable prefix @@ -156,7 +156,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) } test += tmp[test.length()]; } - fl_set_input(ob, test.c_str()); + set_input(test); // How should the possible matches // be visualized? @@ -189,7 +189,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) // no such func/item stored_set(input); string const tmp = input + _(" [no match]"); - fl_set_input(ob, tmp.c_str()); + set_input(tmp); } else { #endif // Return the inputted string @@ -213,7 +213,7 @@ int MiniBuffer::peek_event(FL_OBJECT * ob, int event, int key) { stored_set(input); string const tmp = input + _(" [no match]"); - fl_set_input(ob, tmp.c_str()); + set_input(tmp); return 1; } } @@ -246,7 +246,7 @@ int C_MiniBuffer_peek_event(FL_OBJECT * ob, int event, void MiniBuffer::prepare() { text.erase(); - fl_set_input(the_buffer, ""); + set_input(""); activate(); fl_set_focus_object(static_cast(owner_)->getForm(), the_buffer); @@ -270,7 +270,7 @@ FL_OBJECT * MiniBuffer::add(int type, FL_Coord x, FL_Coord y, obj->u_vdata = this; obj->wantkey = FL_KEY_TAB; - fl_set_input(the_buffer, text.c_str()); + set_input(text); return obj; } @@ -281,7 +281,7 @@ void MiniBuffer::message(string const & str) timer.restart(); string const ntext = strip(str); if (!the_buffer->focus) { - fl_set_input(the_buffer, ntext.c_str()); + set_input(ntext); text = ntext; } } @@ -336,18 +336,27 @@ void MiniBuffer::init() void MiniBuffer::activate() { fl_activate_object(the_buffer); - fl_redraw_object(the_buffer); + redraw(); } void MiniBuffer::deactivate() { - fl_redraw_object(the_buffer); + redraw(); fl_deactivate_object(the_buffer); + XFlush(fl_display); } void MiniBuffer::redraw() { fl_redraw_object(the_buffer); + XFlush(fl_display); +} + + +void MiniBuffer::set_input(string const & str) +{ + fl_set_input(the_buffer, str.c_str()); + XFlush(fl_display); } diff --git a/src/minibuffer.h b/src/minibuffer.h index eb75794ecf..14eb5221f0 100644 --- a/src/minibuffer.h +++ b/src/minibuffer.h @@ -68,6 +68,8 @@ private: /// void stored_set(string const &); /// + void set_input(string const &); + /// void init(); /// string stored_input; -- 2.39.5