Bug 313734 - konsole profiles widget looses cursor highlight
Summary: konsole profiles widget looses cursor highlight
Status: RESOLVED FIXED
Alias: None
Product: plasma4
Classification: Unmaintained
Component: widget-konsoleprofiles (show other bugs)
Version: 4.11.2
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Plasma Bugs List
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2013-01-23 07:47 UTC by g111
Modified: 2014-05-01 16:44 UTC (History)
1 user (show)

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


Attachments
Fix previously proposed (610 bytes, patch)
2014-04-26 06:36 UTC, Renato Atilio
Details

Note You need to log in before you can comment on or make changes to this bug.
Description g111 2013-01-23 07:47:20 UTC
KDE 4.9.4/Kubuntu

I have some konsole profiles defined and am using the konsole profile to open a shell in a specific profile . For this I have configured a hotley leftWindowsKey+Shift+t to open the konsole profiles widget that is placed into the main panel that resides at the bottom of the screen.

Opening the widget via hotkey lets choose you the preferred profile by using the cursor up/down keys. The active profile item is highlighted by a light grey bar that is moving from profile to profile as you use the cursor keys. When pressing the return key a new konsole window is opened with the chosen profile.

The problem: After using the widget several times the highlighting bar disappears. You do not see anymore which entry is currently activated, though the navigation and opening of a konsole still works. But you have to navigate blindly.

When moving the mouse cursor above the menu the highlighting bar occurs again. Moving the mouse away lets it disappear again.

I am not sure when this happens. I think after chosing a profile the first time with the mouse (by clicking an entry) instead of using the profile via keyboard leads to the error.

Reproducible: Always

Steps to Reproduce:
1. Define some profiles in konsole
2. place the "konsole profiles" widget into the main panel.
3. Define a hotkey to open the widget in the "konsole profiles" widget Settings.
4. Open the widget via the hotkey and open a konsole window with any of the profiles by pressing return.
5. Open the widget via the hotkey and open a konsole window with any of the profiles by left clicking it with the mouse.
6. Open the widget via the hotkey. The highlighting bar has disappeared. You do not see which menu item is active (at least as long the mouse cursor is not hovering above the widget menu).
7. If it cannot be reproduced retry 4. - 7.

Actual Results:  
The highlighting bar disappears.

Expected Results:  
The highlighting bar should be present so that you can see which profile entry is currently active.
Comment 1 Jekyll Wu 2013-01-24 11:35:25 UTC
Hmm, that plasmoid is not developed by konsole developers.
Comment 2 g111 2013-06-11 06:46:04 UTC
The problem is, that on "mouse exited" the cursor highlight is turned off. But it is not turned on again when using the keyboard. Because you need always to see the active element when opening the widget via hotkey, the highlighting never should be turned off.  If you comment out this one line, the widget works fine:

diff -u ~root/konsoleprofiles.qml /usr/share/kde4/apps/plasma/plasmoids/konsoleprofiles/contents/ui/konsoleprofiles.qml
--- /root/konsoleprofiles.qml   2013-06-11 08:34:26.990840382 +0200
+++ /usr/share/kde4/apps/plasma/plasmoids/konsoleprofiles/contents/ui/konsoleprofiles.qml       2013-06-11 08:36:00.694837868 +0200
@@ -148,7 +148,7 @@                                                                                                               
                 }                                                                                                                
                                                                                                                                       
                 onExited: {                                                                                                                 
-                    view.highlightItem.opacity = 0                                                                                               
+//                    view.highlightItem.opacity = 0                                                                                                  
                 }                                                                                                                                          
             }                                                                                                                                                 


This line is inside the ListView{} block:

            MouseArea {
                height: parent.height + 15
                anchors { left: parent.left; right: parent.right;}
                hoverEnabled: true

                onClicked: {
                    openProfile();
                }

                onEntered: {
                    view.currentIndex = index
                    view.highlightItem.opacity = 1
                }

                onExited: {
//                    view.highlightItem.opacity = 0
                }
            }
Comment 3 g111 2013-10-19 10:06:27 UTC
This bug is still present in KDE 4.11.2 (Kubuntu 13.10). Why don't you fix it? The solution is simple (see above). Just uncomment the two lines! It is annoying having to correct this manually  each time the regarding package was updated.

Again: How to reproduce the bug:

1) Define the konsole profiles widget a hotkey.
2) Open the widget with the hotkey. Make sure the mouse cursor does not hover about the widget when it opens up.
3) Now you can move the selected entry up and down using the cursor keys and select the highlighted item by pressing return. This is how it always should work.
4) Move the moouse cursor onto the widget. Then move it out of the widget again.
=> The result is that the highlighting of the active item is turned off.
5) Now try to select another item by using the cursor keys. => You still can start the active profile by pressing return. But you do not see, which profile is marked, because the highlighting is missing.

If you close and open the widget again, the highlighting is still missing. So entering the widget with the mouse once in a session destroys its initially correct behaviour.

Greetings,
Gert
Comment 4 g111 2013-10-19 19:37:31 UTC
Sorry. I mean "comment" (disable/delete) not "uncomment".
Comment 5 g111 2014-04-24 15:56:22 UTC
The bug still exists in KDE 4.13.0.     =:-(

*Please*, could someone of the developers include my suggested one line patch? 

Or make it a two line patch by removing the following two lines, as the first one is no longer needed with the second line removed:

                onEntered: {
                    view.currentIndex = index
//                    view.highlightItem.opacity = 1
                }

                onExited: {
//                    view.highlightItem.opacity = 0
                }
Comment 6 Renato Atilio 2014-04-26 06:36:24 UTC
Created attachment 86273 [details]
Fix previously proposed

I don't know if this solutions works, I just took the proposed solution by g111 and made a diff against the KDE/4.13 branch.
Comment 7 g111 2014-04-29 06:29:44 UTC
Thank you, Renato. I have the hope that the patch could priorize this report somehow even though this widget seems to be unmaintained since a longer time.
Comment 8 Eike Hein 2014-04-30 04:58:57 UTC
Git commit f959ecabf14bd9d1138adb7609ea69c7f6e2b2a3 by Eike Hein.
Committed on 30/04/2014 at 04:58.
Pushed by hein into branch 'master'.

Make usable by keyboard.

M  +14   -4    applets/konsoleprofiles/package/contents/ui/konsoleprofiles.qml

http://commits.kde.org/kdeplasma-addons/f959ecabf14bd9d1138adb7609ea69c7f6e2b2a3
Comment 9 Eike Hein 2014-04-30 05:05:57 UTC
Fix will be in 4.13.1.

I ended up taking a different approach from the patch posted here to retain the behavior of the highlight deco disappearing when the mouse leaves (but using the keyboard will make it appear).
Comment 10 g111 2014-04-30 08:28:42 UTC
Hello Eike,

thank you for adopting this issue.

I downloaded the new qml file and placed it into my kubuntu 14.04 KDE 4.13.0 installation. Your advanced patch does work, but it has one or two drawbacks:

If you open the profile widget via hotkey you still cannot see which entry is selected. So if you press return as first action you do not know which shell profile you will open. You first have to touch a cursor key up or down to make the highlighting visible. I expect and think it is required to see the highlighting directly after opening the widget. So the easiest solution was to never remove the highlighting. (I cannot think of any situation where removing the highlighting was correct. If you hover over an entry with the mouse cursor and move it out of the widget, the highlighting disappears. But you still can press return to start the selected profile. So IMO the entry still has to be highlighted to show the user what will happen if he presses return.)

Another disadvantage: The selected entry always starts from the first entry again when moving it with the cursor key after opening the widget. I would expect that the last entry still was active so you can open a second terminal window of the same profile by just reopening the widget and press return again.

So in my opinion my more simple patch is the better choice. Could you revert the more complex solution and apply my suggested fix? That would be great.

Thank you
Gert
Comment 11 Eike Hein 2014-04-30 09:13:13 UTC
My patch tried to preserve the original mouse behavior appearance-wise, since the original author seemed quite intent on tying the appearance of the deco to mouse contact. In that it's consistent with other lists in Plasma. I agree with your usability points, however, and actual users beat theoretical concerns, so I'll change it as you prefer.
Comment 12 Eike Hein 2014-04-30 15:33:07 UTC
Git commit 9b1f219f6ad05c2dbfcb8b6fb608e24aaf9cdbac by Eike Hein.
Committed on 30/04/2014 at 15:31.
Pushed by hein into branch 'master'.

Don't try to be clever with the highlight item opacity.

Turns out the original author's intent to tie the existence of the
highlight deco strictly to mouse contact is basically incompatible
with the desires of keyboard-only users, who need persistent and
immediate feedback on the view's current item.

M  +0    -13   applets/konsoleprofiles/package/contents/ui/konsoleprofiles.qml

http://commits.kde.org/kdeplasma-addons/9b1f219f6ad05c2dbfcb8b6fb608e24aaf9cdbac
Comment 13 g111 2014-05-01 09:27:32 UTC
Thank you again, Eike.

I am really looking forward to not having to patch this file after every KDE update soon.

Greetings
Gert
Comment 14 Eike Hein 2014-05-01 16:44:24 UTC
You're welcome :)