]> git.lyx.org Git - lyx.git/commitdiff
make sure the Xserver updates the input
authorLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 4 Aug 2001 10:26:01 +0000 (10:26 +0000)
committerLars Gullik Bjønnes <larsbj@gullik.org>
Sat, 4 Aug 2001 10:26:01 +0000 (10:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2419 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/LaTeX.C
src/minibuffer.C
src/minibuffer.h

index 945e7af41125c6c52b838ef734b2e9dbfe41f533..9c638823d99eeed114c639f460b47651e70ea3f9 100644 (file)
@@ -1,3 +1,7 @@
+2001-08-04  Lars Gullik Bjønnes  <larsbj@birdstep.com>
+
+       * minibuffer.C: make sure the X server sees the changes in the input.
+
 2001-08-03  Lars Gullik Bjønnes  <larsbj@birdstep.com>
 
        * paragraph.C (getFont): split into...
index c4ce8c3398c1fe6677ee14434960fb5466fc3975..77598bf9f69c7ac964cfdb53d601fda3a8bc92ed 100644 (file)
@@ -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")));
        }
        
index 68614d0910dcfe6ebda4474a073cc9e969f94561..95ebfe3d4a3e16611c77a3c1552f084996299df9 100644 (file)
@@ -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<XFormsView *>(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);
 }
index eb75794ecfc4406682ae06344d17c43758772e8c..14eb5221f0a3e02d64b840ae257968814dfe1cd8 100644 (file)
@@ -68,6 +68,8 @@ private:
        ///
        void stored_set(string const &);
        ///
+       void set_input(string const &);
+       ///
        void init();
        ///
        string stored_input;