Summary: | Using mousewheel to scroll does not work over scrollbar | ||
---|---|---|---|
Product: | [Applications] kate | Reporter: | Alex Ruddick <alexrudd0> |
Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | christoph, dpalacio, herve, job, mail, mpictor |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Ubuntu | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Alex Ruddick
2008-04-29 21:31:49 UTC
*** Bug 161880 has been marked as a duplicate of this bug. *** I can confirm this with kate 4.0.74 installed from debian experimental packages. Hello, I took some time this morning and tried to fix this bug... There are two ways to fix this actually. My first thought was to override whellEvent on the scrollbar and send the event to the view, something like this (tested with kwrite and works, patch is against kdelibs r834504): Index: kate/view/kateviewhelpers.cpp =================================================================== --- kate/view/kateviewhelpers.cpp (revision 834504) +++ kate/view/kateviewhelpers.cpp (working copy) @@ -188,6 +188,11 @@ } } +void KateScrollBar::wheelEvent(QWheelEvent *e) +{ + QCoreApplication::sendEvent(m_viewInternal, e); +} + void KateScrollBar::marksChanged() { recomputeMarksPositions(); Index: kate/view/kateviewhelpers.h =================================================================== --- kate/view/kateviewhelpers.h (revision 834504) +++ kate/view/kateviewhelpers.h (working copy) @@ -73,6 +73,7 @@ virtual void resizeEvent(QResizeEvent *); virtual void styleChange(QStyle &oldStyle); virtual void sliderChange ( SliderChange change ); + virtual void wheelEvent(QWheelEvent *e); protected Q_SLOTS: void sliderMaybeMoved(int value); ...but then I found a commented-out hack that works too if uncommented. It seems to have been commented out in r473347 (more than two years ago) for some reason. Just uncommenting this works too and seems to be the right thing to do, unless it causes some regression or other trouble. The decision is yours... :) Index: kate/view/kateviewinternal.cpp =================================================================== --- kate/view/kateviewinternal.cpp (revision 834504) +++ kate/view/kateviewinternal.cpp (working copy) @@ -144,7 +144,7 @@ connect(m_lineScroll, SIGNAL(sliderMMBMoved(int)), SLOT(scrollLines(int))); // catch wheel events, completing the hijack - //m_lineScroll->installEventFilter(this); + m_lineScroll->installEventFilter(this); // // scrollbar for columns *** Bug 164360 has been marked as a duplicate of this bug. *** *** This bug has been marked as a duplicate of bug 158466 *** SVN commit 858143 by cullmann: fix scrolling with wheel on scrollbar BUG: 161412 M +5 -0 kateviewhelpers.cpp M +1 -0 kateviewhelpers.h --- trunk/KDE/kdelibs/kate/view/kateviewhelpers.cpp #858142:858143 @@ -196,6 +196,11 @@ } } +void KateScrollBar::wheelEvent(QWheelEvent *e) +{ + QCoreApplication::sendEvent(m_viewInternal, e); +} + void KateScrollBar::marksChanged() { recomputeMarksPositions(); --- trunk/KDE/kdelibs/kate/view/kateviewhelpers.h #858142:858143 @@ -74,6 +74,7 @@ virtual void resizeEvent(QResizeEvent *); virtual void styleChange(QStyle &oldStyle); virtual void sliderChange ( SliderChange change ); + virtual void wheelEvent(QWheelEvent *e); protected Q_SLOTS: void sliderMaybeMoved(int value); I still have this bug in KDE 4.1.3/Kate 3.1.3 >I still have this bug in KDE 4.1.3/Kate 3.1.3
I second that
It works fine in trunk. It was simply not backported to the 4.1 branch. *** Bug 185197 has been marked as a duplicate of this bug. *** |