From: Georg Baum Date: Sun, 30 Jul 2006 14:57:01 +0000 (+0000) Subject: Fix redraw problems in qt3 and gtk X-Git-Tag: 1.6.10~12901 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e6e554d68cbcd30eb2a1c935085520cda95c9bb9;p=features.git Fix redraw problems in qt3 and gtk * src/frontends/gtk/GWorkArea.C (GWorkArea::onScroll): redraw the workarea (GWorkArea::onButtonPress): Call WorkArea::dispatch instead of BufferView::workAreaDispatch in order to redraw the workarea (GWorkArea::onButtonRelease): ditto (GWorkArea::onMotionNotify): ditto * src/frontends/WorkArea.h (dispatch): make public * src/frontends/qt3/QContentPane.C (QContentPane::scrollBarChanged): redraw the workarea (QContentPane::generateSyntheticMous): Call WorkArea::dispatch instead of BufferView::workAreaDispatch in order to redraw the workarea (QContentPane::mousePressEvent): ditto (QContentPane::mouseReleaseEvent): ditto (QContentPane::mouseMoveEvent): ditto (QContentPane::doubleClickTimeout): ditto git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14517 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/WorkArea.h b/src/frontends/WorkArea.h index 1405c8f2ea..edd0742310 100644 --- a/src/frontends/WorkArea.h +++ b/src/frontends/WorkArea.h @@ -105,9 +105,11 @@ protected: /// cause the display of the given area of the work area virtual void expose(int x, int y, int w, int h) = 0; - /// +public: + /// FIXME: This is public because of qt3 and gtk, should be protected void dispatch(FuncRequest const & cmd0); +protected: /// void resizeBufferView(); diff --git a/src/frontends/gtk/GWorkArea.C b/src/frontends/gtk/GWorkArea.C index 3d035f777e..35cbbc4499 100644 --- a/src/frontends/gtk/GWorkArea.C +++ b/src/frontends/gtk/GWorkArea.C @@ -377,6 +377,7 @@ void GWorkArea::onScroll() double val = vscrollbar_.get_adjustment()->get_value(); view_.view()->scrollDocView(static_cast(val)); + view_.workArea()->redraw(); adjusting_ = false; } @@ -422,7 +423,7 @@ bool GWorkArea::onButtonPress(GdkEventButton * event) default: break; } - view_.view()->workAreaDispatch(FuncRequest(ka, + view_.workArea()->dispatch(FuncRequest(ka, static_cast(event->x), static_cast(event->y), gButtonToLyx(event->button))); @@ -433,7 +434,7 @@ bool GWorkArea::onButtonPress(GdkEventButton * event) bool GWorkArea::onButtonRelease(GdkEventButton * event) { - view_.view()->workAreaDispatch(FuncRequest(LFUN_MOUSE_RELEASE, + view_.workArea()->dispatch(FuncRequest(LFUN_MOUSE_RELEASE, static_cast(event->x), static_cast(event->y), gButtonToLyx(event->button))); @@ -458,7 +459,7 @@ bool GWorkArea::onMotionNotify(GdkEventMotion * event) } timeBefore = event->time; } - view_.view()->workAreaDispatch(FuncRequest(LFUN_MOUSE_MOTION, + view_.workArea()->dispatch(FuncRequest(LFUN_MOUSE_MOTION, static_cast(event->x), static_cast(event->y), gtkButtonState(event->state))); diff --git a/src/frontends/qt3/QContentPane.C b/src/frontends/qt3/QContentPane.C index 7e38b328f7..16afe8d1fb 100644 --- a/src/frontends/qt3/QContentPane.C +++ b/src/frontends/qt3/QContentPane.C @@ -162,15 +162,17 @@ void QContentPane::generateSyntheticMouseEvent() synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; // ... and dispatch the event to the LyX core. - wa_->view().view()->workAreaDispatch(synthetic_mouse_event_.cmd); + wa_->view().workArea()->dispatch(synthetic_mouse_event_.cmd); } } void QContentPane::scrollBarChanged(int val) { - if (track_scrollbar_) + if (track_scrollbar_) { wa_->view().view()->scrollDocView(val); + wa_->view().workArea()->redraw(); + } } @@ -181,13 +183,13 @@ void QContentPane::mousePressEvent(QMouseEvent * e) FuncRequest cmd(LFUN_MOUSE_TRIPLE, dc_event_.x, dc_event_.y, q_button_state(dc_event_.state)); - wa_->view().view()->workAreaDispatch(cmd); + wa_->view().workArea()->dispatch(cmd); return; } FuncRequest const cmd(LFUN_MOUSE_PRESS, e->x(), e->y(), q_button_state(e->button())); - wa_->view().view()->workAreaDispatch(cmd); + wa_->view().workArea()->dispatch(cmd); } @@ -198,7 +200,7 @@ void QContentPane::mouseReleaseEvent(QMouseEvent * e) FuncRequest const cmd(LFUN_MOUSE_RELEASE, e->x(), e->y(), q_button_state(e->button())); - wa_->view().view()->workAreaDispatch(cmd); + wa_->view().workArea()->dispatch(cmd); } @@ -258,7 +260,7 @@ void QContentPane::mouseMoveEvent(QMouseEvent * e) synthetic_mouse_event_.scrollbar_value_old = scrollbar_value; // ... and dispatch the event to the LyX core. - wa_->view().view()->workAreaDispatch(cmd); + wa_->view().workArea()->dispatch(cmd); } } @@ -317,7 +319,7 @@ void QContentPane::doubleClickTimeout() FuncRequest cmd(LFUN_MOUSE_DOUBLE, dc_event_.x, dc_event_.y, q_button_state(dc_event_.state)); - wa_->view().view()->workAreaDispatch(cmd); + wa_->view().workArea()->dispatch(cmd); }