]> git.lyx.org Git - features.git/commitdiff
Fix redraw problems in qt3 and gtk
authorGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 30 Jul 2006 14:57:01 +0000 (14:57 +0000)
committerGeorg Baum <Georg.Baum@post.rwth-aachen.de>
Sun, 30 Jul 2006 14:57:01 +0000 (14:57 +0000)
* 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

src/frontends/WorkArea.h
src/frontends/gtk/GWorkArea.C
src/frontends/qt3/QContentPane.C

index 1405c8f2ea5329885c76a21234353701a8214f52..edd0742310ab84e904a0f9d92ecc2880c4edf61c 100644 (file)
@@ -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();
 
index 3d035f777efbcd4db0e32031f85ff3972b2e8920..35cbbc44992de04d298d28ad84296cbd63b2b917 100644 (file)
@@ -377,6 +377,7 @@ void GWorkArea::onScroll()
 
        double val = vscrollbar_.get_adjustment()->get_value();
        view_.view()->scrollDocView(static_cast<int>(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<int>(event->x),
                             static_cast<int>(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<int>(event->x),
                             static_cast<int>(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<int>(event->x),
                             static_cast<int>(event->y),
                             gtkButtonState(event->state)));
index 7e38b328f735fc5cf8fc41bb8ee136e9a0816886..16afe8d1fb32ebffbfd0a6e63d9ca5b854da6922 100644 (file)
@@ -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);
 }