Skip to content

KUrlNavigatorMenu: fix middle-click handling

Ilia Kats requested to merge (removed):fix_kurlnnavbtn_middleclick into master

Since commit 39c0446d, a left-click event is emitted on every activation of the menu, which includes middle-clicks. Therefore, upon middle-click e.g. in Dolphin, both a new tab is opened and the current tab navigates to the new URL. This is not desired.

By setting the active action to NULL after we handled the event, we still make Qt handle the logic of closing the menu and submenus, but we avoid emitting two events.

Note that while basic keyboard handling could be implemented by also adding a custom handler for keyPressEvents, this would be feasible only for the Enter key. The current implementation also handles menu shorcuts (e.g. pressing a will active a directory starting with a).

Edited by Ilia Kats

Merge request reports