From 06c81c0ec4d9bd827971c6b8d5a53b1f9d9c5d8f Mon Sep 17 00:00:00 2001 From: John Levon Date: Tue, 3 Jun 2003 19:32:08 +0000 Subject: [PATCH] fix the fix for bug 818. Hopefully. Damn I hate this stuff git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7096 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/ChangeLog | 6 ++++++ src/frontends/lyx_gui.h | 5 +++++ src/frontends/qt2/ChangeLog | 5 +++++ src/frontends/qt2/lyx_gui.C | 6 ++++++ src/frontends/qt2/qscreen.C | 11 +++-------- src/frontends/screen.C | 10 +++++++--- src/frontends/xforms/ChangeLog | 4 ++++ src/frontends/xforms/lyx_gui.C | 6 ++++++ 8 files changed, 42 insertions(+), 11 deletions(-) diff --git a/src/frontends/ChangeLog b/src/frontends/ChangeLog index aff1f50613..6001e4226c 100644 --- a/src/frontends/ChangeLog +++ b/src/frontends/ChangeLog @@ -1,3 +1,9 @@ +2003-06-03 John Levon + + * lyx_gui.h: add sync_events() + + * screen.C: sync events before showing the cursor + 2003-05-08 Lars Gullik Bjønnes * Makefile.am: better lib building diff --git a/src/frontends/lyx_gui.h b/src/frontends/lyx_gui.h index e42bb9fe6a..f0b2447a4c 100644 --- a/src/frontends/lyx_gui.h +++ b/src/frontends/lyx_gui.h @@ -53,6 +53,11 @@ void parse_lyxrc(); */ void start(string const & batch, std::vector const & files); +/** + * Synchronise all pending events. + */ +void sync_events(); + /** * quit running LyX */ diff --git a/src/frontends/qt2/ChangeLog b/src/frontends/qt2/ChangeLog index 5a1d569d40..fe4522e8b5 100644 --- a/src/frontends/qt2/ChangeLog +++ b/src/frontends/qt2/ChangeLog @@ -1,3 +1,8 @@ +2003-06-03 John Levon + + * lyx_gui.C: add sync_events() + * qscreen.C: remove previous hack for bug 818 + 2003-06-03 John Levon * qscreen.C: paint before saving the cursor pixmap diff --git a/src/frontends/qt2/lyx_gui.C b/src/frontends/qt2/lyx_gui.C index 870ae4c66c..b397acf0bd 100644 --- a/src/frontends/qt2/lyx_gui.C +++ b/src/frontends/qt2/lyx_gui.C @@ -177,6 +177,12 @@ void start(string const & batch, vector const & files) } +void sync_events() +{ + qApp->processEvents(); +} + + void exit() { delete lyxserver; diff --git a/src/frontends/qt2/qscreen.C b/src/frontends/qt2/qscreen.C index 0669696b19..f5b85dbdab 100644 --- a/src/frontends/qt2/qscreen.C +++ b/src/frontends/qt2/qscreen.C @@ -129,17 +129,12 @@ void QScreen::showCursor(int x, int y, int h, Cursor_Shape shape) nocursor_pixmap_.reset(new QPixmap(cursor_w_, cursor_h_)); } - // save old area - bitBlt(nocursor_pixmap_.get(), 0, 0, owner_.getPixmap(), - cursor_x_, cursor_y_, cursor_w_, cursor_h_); - if (!qApp->focusWidget()) return; - // We could have pending paints. If we don't process them - // before, we end up with pixel dirt when the cursor is - // in insets - qApp->processEvents(); + // save old area + bitBlt(nocursor_pixmap_.get(), 0, 0, owner_.getPixmap(), + cursor_x_, cursor_y_, cursor_w_, cursor_h_); Painter & pain(owner_.getPainter()); pain.start(); diff --git a/src/frontends/screen.C b/src/frontends/screen.C index 0ec0a0daee..14baa80f9c 100644 --- a/src/frontends/screen.C +++ b/src/frontends/screen.C @@ -27,6 +27,7 @@ #include "rowpainter.h" #include "insets/updatableinset.h" #include "mathed/formulabase.h" +#include "lyx_gui.h" // Splash screen-specific stuff #include "lyxfont.h" @@ -131,6 +132,10 @@ LyXScreen::~LyXScreen() void LyXScreen::showCursor(BufferView & bv) { + // this is needed to make sure we copy back the right + // pixmap on the hide for the Qt frontend + lyx_gui::sync_events(); + if (cursor_visible_) return; @@ -189,9 +194,8 @@ void LyXScreen::showCursor(BufferView & bv) if (y < 0 || y + h > workarea().workHeight()) return; - showCursor(x, y, h, shape); - cursor_visible_ = true; + showCursor(x, y, h, shape); } @@ -200,8 +204,8 @@ void LyXScreen::hideCursor() if (!cursor_visible_) return; - removeCursor(); cursor_visible_ = false; + removeCursor(); } diff --git a/src/frontends/xforms/ChangeLog b/src/frontends/xforms/ChangeLog index 815f560a57..d256e10204 100644 --- a/src/frontends/xforms/ChangeLog +++ b/src/frontends/xforms/ChangeLog @@ -1,3 +1,7 @@ +2003-06-03 John Levon + + * lyx_gui.C: add sync_events() + 2003-06-03 Angus Leeming * FormGraphics.C (build): a few comments. diff --git a/src/frontends/xforms/lyx_gui.C b/src/frontends/xforms/lyx_gui.C index 4c8aeb04f9..cb3849f539 100644 --- a/src/frontends/xforms/lyx_gui.C +++ b/src/frontends/xforms/lyx_gui.C @@ -325,6 +325,12 @@ void exit() } +void sync_events() +{ + // FIXME +} + + FuncStatus getStatus(FuncRequest const & /*ev*/) { // Nothing interesting to do here -- 2.39.2