[okular] [Bug 443404] Mousewheel scroll does not work in full page size and non-continous mode for some mouses

2022-07-18 Thread Zack
https://bugs.kde.org/show_bug.cgi?id=443404

--- Comment #11 from Zack  ---
I looked into the source code and added few lines to the pageview.cpp to handle
the small "delta" value reported in the PageView::wheelEvent for my mice. And
now I could scroll in pages in full page view and non-continous mode. (only
tested on libinput mode but not in evdev mode)

I don't know how I should request code change. Here's the few lines that I
added. Maybe the developers see this and test it or possibly merge into the
main branch.

--- okular-21.12.3/part/pageview_orig.cpp   2022-02-28 02:11:02.0
+0800
+++ okular-21.12.3/part/pageview.cpp2022-07-19 00:07:04.332931401 +0800
@@ -3170,22 +3170,32 @@
 if ((e->modifiers() & Qt::ControlModifier) == Qt::ControlModifier) {
 d->controlWheelAccumulatedDelta += delta;
 if (d->controlWheelAccumulatedDelta <=
-QWheelEvent::DefaultDeltasPerStep) {
 slotZoomOut();
 d->controlWheelAccumulatedDelta = 0;
 } else if (d->controlWheelAccumulatedDelta >=
QWheelEvent::DefaultDeltasPerStep) {
 slotZoomIn();
 d->controlWheelAccumulatedDelta = 0;
 }
 } else {
-d->controlWheelAccumulatedDelta = 0;
-
+if (d->controlWheelAccumulatedDelta * delta < 0) {
+d->controlWheelAccumulatedDelta = 0;
+}
+d->controlWheelAccumulatedDelta += delta;
+if (abs(d->controlWheelAccumulatedDelta) >=
QWheelEvent::DefaultDeltasPerStep){
+delta = d->controlWheelAccumulatedDelta > 0 ?
QWheelEvent::DefaultDeltasPerStep : -QWheelEvent::DefaultDeltasPerStep;
+d->controlWheelAccumulatedDelta = 0;
+}
+else {
+delta = 0;
+}
+
 if (delta <= -QWheelEvent::DefaultDeltasPerStep &&
!getContinuousMode() && vScroll == verticalScrollBar()->maximum()) {
 // go to next page
 if ((int)d->document->currentPage() < d->items.count() - 1) {
 // more optimized than document->setNextPage and then move
view to top
 Okular::DocumentViewport newViewport =
d->document->viewport();
 newViewport.pageNumber += viewColumns();
 if (newViewport.pageNumber >= (int)d->items.count())
 newViewport.pageNumber = d->items.count() - 1;
 newViewport.rePos.enabled = true;
 newViewport.rePos.normalizedY = 0.0;

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 456521] Buggy drop-down menu when another window is focused

2022-07-18 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=456521

Albert Astals Cid  changed:

   What|Removed |Added

 CC||aa...@kde.org
   Keywords||wayland

-- 
You are receiving this mail because:
You are the assignee for the bug.

[okular] [Bug 443404] Mousewheel scroll does not work in full page size and non-continous mode for some mouses

2022-07-18 Thread Albert Astals Cid
https://bugs.kde.org/show_bug.cgi?id=443404

--- Comment #12 from Albert Astals Cid  ---
> I don't know how I should request code change

https://community.kde.org/Infrastructure/GitLab#Submitting_a_Merge_Request

-- 
You are receiving this mail because:
You are the assignee for the bug.