Bug 248962 - ktabbar does not change page on wheel events
Summary: ktabbar does not change page on wheel events
Status: CLOSED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: kdeui (show other bugs)
Version: SVN
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-25 05:40 UTC by David Palacio
Modified: 2010-09-08 18:20 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
move behaviour to KTabBar (1.65 KB, patch)
2010-08-25 05:40 UTC, David Palacio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Palacio 2010-08-25 05:40:24 UTC
Created attachment 50919 [details]
move behaviour to KTabBar

Version:           SVN (using Devel) 
OS:                Linux

For some reason KTabBar does not change page itself but sends a signal that KTabWidget use to change the page instead.

A problem arises when programs do use KTabBar directly instead of KTabWidget (e.g. the web browser Rekonq). Such programs do not switch tabs when the mouse wheel is scrolled over them. The attached patch solves this problem.

The proposed solution moves the behaviour implementation from KTabWidget to KTabBar, disables and disconnects the relevant signal in KTabBar/KTabWidget.

Reproducible: Didn't try




With the patch applied, Konqueror, Konsole and Rekonq all work as expected with regard to tabs.

Note that QTabBar in Qt already implements this with a small difference: it does not wrap around the extreme tabs. That is, it will not go from the last to the first tab and viceversa.
Comment 1 Frank Reininghaus 2010-08-27 10:38:42 UTC
Thanks for the patch. You might want to file a review request at http://reviewboard.kde.org/ - patches get overlooked quite easily here at bugs.kde.org.
Comment 2 David Faure 2010-09-01 14:11:35 UTC
I don't know why it was done this way indeed. SVN history points to r309732 by binner, implementing bug 77946.

The problem with changing this now, is that it would break applications that expect KTabBar to emit wheelDelta rather than changing pages all by itself.
LXR says:

http://lxr.kde.org/source/extragear/sdk/kdevplatform-git/sublime/container.cpp#181

http://lxr.kde.org/source/KDE/kdebase/apps/konsole/src/ViewContainer.cpp#472

http://lxr.kde.org/source/KDE/kdebase/apps/dolphin/src/dolphinmainwindow.cpp#1244

Well, all three of them of course do something like changing pages, but in different ways, so I wonder if they have special requirements.
Adding apaku (for kdevelop), Peter (for dolphin) and Robert Knight (for konsole) to the CC.
Guys? Would it create a problem for you if KTabBar handled mouse wheel events and you could delete your wheelDelta-connected slot?
Comment 3 Peter Penz 2010-09-01 14:24:14 UTC
From a Dolphin point of view I'd be glad to remove the custom handling of the wheel for tabs from dolphinmainwindow.
Comment 4 David Palacio 2010-09-01 18:33:22 UTC
See http://reviewboard.kde.org/r/5184/ for discussion on the proposed solutions.
Comment 5 David Faure 2010-09-01 20:42:45 UTC
Argh it would have been nice to link the reviewboard url to this bug upfront, I wouldn't have spent time doing the same investigation :(
Comment 6 David Palacio 2010-09-03 13:36:01 UTC
SVN commit 1171318 by davidp:

Move tab switching by mouse wheel scrolling from KTabWidget to KTabBar.
Skip disabled pages.

BUG: 248617
BUG: 248962


 M  +24 -3     ktabbar.cpp  
 M  +2 -8      ktabwidget.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1171318
Comment 7 Peter Penz 2010-09-04 15:50:55 UTC
SVN commit 1171577 by ppenz:

Remove custom handling of wheel-events for tabs, this is done now in KTabBar

CCBUG: 248962



 M  +0 -11     dolphinmainwindow.cpp  
 M  +0 -3      dolphinmainwindow.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1171577