Fix for CTRL+Tab not switcing tabs in Konqueror when the active tab is a Dolphin filemanagement part
Review Request #106569 - Created Sept. 25, 2012 and submitted
This patch fixes a bug where pressing CTRL+Tab does not switch tabs when active tab in Konqueror is a Dolphin's filemanagement part. It happens because DolphinView installs an event filter and does not call event->ignore() or event->setAccepted(false) to allow those events to be propagated up the event chain.
Thanks for analysing this issue and for the patch! We should of course let those events propagate. However, I'm a bit confused. The docs of QObject::eventFilter() don't mention anything about setting the 'accepted' state of the event. If I understand it correctly, the event is filtered (i.e., not handled further) only if eventFilter() returns true. Even if your patch fixes the issue, I'm therefore wondering if it just hides the real bug. I think that what is actually supposed to happen is that DolphinView does not filter the event and that the KItemListView does not handle the event either, such that the unhandled event is passed through to the parent widgets until it ends up in the KonqCombo, such that KonqMainWindow::eventFilter() gets it, right? If that is true, I think the real bug might be that some class pretends to handle the event, such that its parents don't see it, although it does nothing with the event. I had a quick look at the code and found that KItemListView::event() accepts the event and returns true if m_controller->processEvent() returns true, but does not ignore() the event if that is not the case. I haven't tested it yet, but maybe that is the real problem?
Thanks Dawit for the explanation! I had a quick look at the Konqueror sources last night, but apparently I was too tired to find the right place in KonqView. I only saw that KonqMainWindow installs an event filter for the KonqCombo, but that is of course irrelevant to the bug that we see here (somehow my tired brain confused KonqCombo with Konqueror's tab class and thought that the unhandled event must end up there at some point). I'm glad that you fixed the real root cause of the bug now. Who knows, maybe that might have caused even more bugs in the future. Thanks again, feel free to push to 4.9.