Bug 271325 - +/- selection icons stop appearing after aborting context menu
Summary: +/- selection icons stop appearing after aborting context menu
Status: RESOLVED INTENTIONAL
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 2.1
Platform: Compiled Sources Linux
: NOR minor
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords: investigated, reproducible
Depends on:
Blocks:
 
Reported: 2011-04-20 02:50 UTC by Christoph Feck
Modified: 2013-08-25 13:53 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Feck 2011-04-20 02:50:15 UTC
Version:           unspecified (using Devel) 
OS:                Linux



Reproducible: Didn't try

Steps to Reproduce:
* go into a folder with (say) 20 files
* press Ctrl+A to "Select All"
* note that hovering over the selected files shows the red "-" icon at the top-left corner to deselect
* right-click on an item
* cancel the menu by left-clicking outside Dolphins window
* hover over still selected files

Actual Results:  
The "-" icon stops appearing when hovering over the items

Expected Results:  
It should still appear

It works correctly, if you cancel the menu by clicking into the Dolphin window.
Comment 1 Frank Reininghaus 2011-04-21 21:20:12 UTC
The place where it goes wrong is in

SelectionManager::slotEntered(const QModelIndex& index), 

which is called when the mouse cursor enters an item in the view.

In the described use case, 'QApplication::mouseButtons()' returns 'Qt::LeftButton '(even though the button isn't pressed at all), such that the bool 'isSelectionCandidate' is set to false.

Looks like a Qt bug to me. It seems that the application gets the 'mouse press' event when the left-click outside the Dolphin window is done, but not the release event, because the Dolphin window doesn't have the focus any more when the button is released. The result is that Qt thinks that the button is still pressed.

We had a very similar problem concerning keyboard modifiers (bug 178679), maybe the mouse button issue can be solved in a similar way. I'll try to have a look when I find some time.
Comment 2 Jeroen van Meeuwen (Kolab Systems) 2012-08-24 16:19:51 UTC
Resetting assignee to default as per bug #305719
Comment 3 Frank Reininghaus 2013-08-25 12:23:28 UTC
Reported to Qt: https://bugreports.qt-project.org/browse/QTBUG-33161
Comment 4 Frank Reininghaus 2013-08-25 13:53:11 UTC
Apparently the behavior of QApplication::mouseButtons() is intentional. Therefore, we could only fix this by using something different to find the current state of the mouse buttons. I am not planning to do this (I don't even know if there is a good cross-platform way to do that), so the correct resolution is WONTFIX.

Sorry about that.