By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.

Bug 909

Summary: Konsole: Add check box to control mouse wheel cycling over tab bar
Product: TDE Reporter: Darrell <darrella>
Component: tdebaseAssignee: Michele Calgaro <michele.calgaro>
Status: RESOLVED FIXED    
Severity: normal CC: bugwatch, darrella, michele.calgaro, slavek.banko
Priority: P1    
Version: R14.0.0 [Trinity]   
Hardware: Other   
OS: Linux   
Compiler Version: TDE Version String:
Application Version: Application Name: Konsole
Attachments: Partial patch to provide GUI control for tab cycling
tdelibs and tdebase tab scroll on mouse whell patch
Warnings fixed by the patch

Description Darrell 2012-03-11 13:50:30 CDT
Currently there is no option to control mouse wheel cycling when the mouse pointer hovers over the tab bar. Although useful for many people, the cycling feature is frustrating for others.

In bug report 251 a patch was submitted to add a check box control for task bar application cycling. That patch can be used as a template to add the same control option. ("Cycle through tabs with mouse wheel")
Comment 1 Calvin Morrison 2012-03-31 13:05:25 CDT
I was looking into bug 909 and 910. Basically the wheel scroll action
is built into KDEUI and it is hard coded.

relevant files are:

tdelibs/tdeui/ktabbar.cpp
tdelibs/tdeui/ktabwidget.cpp

What is a solution, a global configuration option? or can we
intercept/disconnect/handle the signal so it doesn't go to ktabbar?
Comment 2 Darrell 2012-03-31 16:32:11 CDT
Add a configuration option.

Konsole: tab bar context menu, Tab Options, Text "&Cycle Tabs With Mouse Wheel" (Initial caps to be consistent with other menu options.)
Comment 3 Darrell 2012-10-08 23:08:56 CDT
Created attachment 858 [details]
Partial patch to provide GUI control for tab cycling

This is a partial attempt at providing a GUI control for tab cycling with the mouse wheel. The new check box control is located in Settings -> Configure Konsole -> General and correctly updates/toggles the user's konsolerc file.

The patch does not yet control tab cycling. I do not know how tab cycling is achieved in konsole.
Comment 4 Calvin Morrison 2012-10-09 15:32:31 CDT
See my comment. that is where the tab cycling actually happens.
Comment 5 Darrell 2012-10-09 16:13:27 CDT
Those functions in tdelibs would be global. Seems then we should introduce a separate mouse wheel event function to the konsole code (and konqueror --- bug report 910), similar to the patch for task bar cycling (bug report 251).

With the GUI controls and respective config file options available, seems we read those config options and then use that to determine whether the new mouse wheel event cycles the tabs. I'm not getting far with how to do this. :(
Comment 6 Darrell 2013-03-02 20:56:20 CST
Patch in attachment 858 [details] pushed in GIT commit d9087191. The patch only provides the GUI check box control and does not control tab cycling.
Comment 7 Michele Calgaro 2013-10-14 00:14:26 CDT
I will look into this bug.
Comment 8 Michele Calgaro 2013-10-15 01:47:33 CDT
Created attachment 1551 [details]
tdelibs and tdebase tab scroll on mouse whell patch
Comment 9 Michele Calgaro 2013-10-15 01:51:01 CDT
I created a patch for this problem.

The tdelibs patch adds the method "setMouseWheelScroll(bool)" to KTabWidget which can be used to enable or disable tab scrolling using the mouse wheel.

The tdebase patch adds support for this functionality to Konsole and also fixes several compiling warning messages regarding "suggested additional parenthesis".

Cheers
  Michele
Comment 10 Darrell 2013-10-15 14:40:42 CDT
I tested the patch. Works fine. The original behavior is cycling is enabled all the time and now the check box disables cycling. Great!

> also fixes several compiling warning messages regarding "suggested additional parenthesis".

Just curious: would your provide some examples? I see no such messages in my build logs.

Slavek, do you want me to push the patch or do you first want to test?
Comment 11 Slávek Banko 2013-10-15 17:29:10 CDT
(Odpověď na komentář #10)
> I tested the patch. Works fine. The original behavior is cycling is enabled all
> the time and now the check box disables cycling. Great!
> 
> > also fixes several compiling warning messages regarding "suggested additional parenthesis".
> 
> Just curious: would your provide some examples? I see no such messages in my
> build logs.
> 
> Slavek, do you want me to push the patch or do you first want to test?

I would like to first look at the patch and also to test it.
In any case, it looks like a good work!
Comment 12 Michele Calgaro 2013-10-16 01:49:52 CDT
Created attachment 1552 [details]
Warnings fixed by the patch
Comment 13 Michele Calgaro 2013-10-16 01:52:05 CDT
(In reply to comment #10)
> I tested the patch. Works fine. The original behavior is cycling is enabled all
> the time and now the check box disables cycling. Great!
> 
> > also fixes several compiling warning messages regarding "suggested additional parenthesis".
> 
> Just curious: would your provide some examples? I see no such messages in my
> build logs.
> 
> Slavek, do you want me to push the patch or do you first want to test?

The file attached above shows the warnings that I get on my computer if I build from the original files

Btw the fix for bug 910 is coming soon, I just need some free time to do it and test it properly before submitting.
Comment 14 Darrell 2013-10-16 10:48:57 CDT
> The file attached above shows the warnings that I get on my computer if I build
> from the original files
I wonder why I don't see the messages?
Comment 15 Michele Calgaro 2013-10-16 22:36:41 CDT
(In reply to comment #14)
> > The file attached above shows the warnings that I get on my computer if I build
> > from the original files
> I wonder why I don't see the messages?

1) Are you using -Wno-parentheses when you compile?
2) (perhaps silly to say) The warnings comes out on stderr, not on stdout.
Comment 16 Darrell 2013-10-17 16:04:41 CDT
> 1) Are you using -Wno-parentheses when you compile?
Not that I am aware. Should I? If yes, why and how?

> 2) (perhaps silly to say) The warnings comes out on stderr, not on stdout.
Okay, that's fine, by build logs capture both. :-)
Comment 17 Darrell 2013-10-17 18:05:29 CDT
> ... by build logs capture both.

That should have been:

my build logs capture both. :-)
Comment 18 Michele Calgaro 2013-10-18 01:55:06 CDT
(In reply to comment #16)
> > 1) Are you using -Wno-parentheses when you compile?
> Not that I am aware. Should I? If yes, why and how?
> 
> > 2) (perhaps silly to say) The warnings comes out on stderr, not on stdout.
> Okay, that's fine, by build logs capture both. :-)

Using -Wno-parentheses would suppress those warnings that were coming out on my computer. 
This is an example taken from my build logs for tdebase. Try to compare with your logs and see if there is any different flag passed to g++

cd /home/tde_src/2_build/build/tdebase/obj-x86_64-linux-gnu/konsole/konsole && /usr/bin/g++   -DHAVE_CONFIG_H -Dtdeinit_konsole_shared_EXPORTS -DSMB_CTX_FLAG_USE_KERBEROS -DSMB_CTX_FLAG_FALLBACK_AFTER_KERBEROS -g -Wall  -D_FORTIFY_SOURCE=2 -fvisibility=hidden -fvisibility-inlines-hidden  -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -I/usr/include/tqt3 -I/usr/include/tqt -DQT_NO_ASCII_CAST -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQT_NO_COMPAT -DQT_NO_TRANSLATION -DQT_THREAD_SUPPORT -D_REENTRANT -include tqt.h -DNDEBUG -fPIC -I/home/tde_src/2_build/build/tdebase/obj-x86_64-linux-gnu/konsole/konsole -I/home/tde_src/2_build/build/tdebase/konsole/konsole -I/home/tde_src/2_build/build/tdebase/obj-x86_64-linux-gnu -I/opt/trinity/include -I/usr/include/tqt3 -I/usr/include/tqt    -o CMakeFiles/tdeinit_konsole-shared.dir/konsole.cpp.o -c /home/tde_src/2_build/build/tdebase/konsole/konsole/konsole.cpp
Comment 19 Michele Calgaro 2013-10-18 01:56:55 CDT
I forgot, this is my compiler version

g++ (Debian 4.8.1-10) 4.8.1
Comment 20 Darrell 2013-10-18 12:33:49 CDT
Oops, my mistake. :-( I do have the messages in my build logs, but I was looking for the wrong text string. In my build logs I see the following:

warning: suggest parentheses around '&&' within '||' [-Wparentheses]

I see those messages in the following build logs:

trinity-amarok
trinity-digikam
trinity-gwenview
trinity-k3b
trinity-k9copy
trinity-kipi-plugins
trinity-python-tqt
trinity-tdeaccessibility
trinity-tdeaddons
trinity-tdeadmin
trinity-tdeedu
trinity-tdegames
trinity-tdemultimedia
trinity-tdewebdev
trinity-tqt3

Fixing these messages seems clerical in nature. Do you have a good handle on what is neeeded? I can push clerical patches without reviews from the code experts.
Comment 21 Michele Calgaro 2013-10-18 14:15:38 CDT
> Fixing these messages seems clerical in nature. Do you have a good handle on
> what is neeeded? I can push clerical patches without reviews from the code
> experts.
Usually it is something like this:

if (cond_A && cond_B || cond_C && cond_D)

which has to be rewritten as: 

if ((cond_A && cond_B) || (cond_C && cond_D))

to avoid the warning message.
Another one is when two if statements are followed by a single else. For example:

if (cond_A)
  if(cond_B)
    do_something;
  else
    do_something_else;

which should be rewritten as:

if (cond_A)
{
  if(cond_B)
    do_something;
  else
    do_something_else;
}
Comment 22 Slávek Banko 2013-10-19 17:56:06 CDT
I split tdebase/konsole patch into two parts. All pushed to GIT in hash 6b1b515 (tdelibs), 6ad5175 (tdebase) and 2a5554c (tdebase).