Bug 142040

Summary: "Focus follows mouse" does not change focus after clicking away a menu
Product: [Plasma] kwin Reporter: munlinux
Component: coreAssignee: KWin default assignee <kwin-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: echidnaman, finex
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:

Description munlinux 2007-02-21 22:24:54 UTC
Version:            (using KDE KDE 3.5.5)
Installed from:    Ubuntu Packages

To demonstrate, do e.g. the following:
- Have a konqueror window and konsole window open, but smaller than your desktop.
- Right click on desktop (you get a context menu).
- Move mouse on konqueror, left click (to get rid of the context menu).

Result: you have to click or move mouse away from konqueror and back in order to get focus on konqueror.

The same result is obtained with the following:
- Right click on konsole (you get a context menu).
- Move mouse on konqueror, left click (to get rid of the context menu).

This is not an issue with focus "under mouse" or "focus strictly under mouse".

This report and bug 81743 share the same topic but seem inverse by content. As I commented on that report, there seem to be different kinds of context menus that behave differently.

(Please also compare the issue reported here with bug 130063.)
Comment 1 Lubos Lunak 2007-03-23 15:54:37 UTC
It seems focus changes are not handled properly while/after input grabs.
Comment 2 Lubos Lunak 2007-03-23 15:54:46 UTC
*** Bug 130063 has been marked as a duplicate of this bug. ***
Comment 3 Jonathan Thomas 2008-09-18 03:24:08 UTC
Still seems to be an issue in KDE4.
Comment 4 FiNeX 2010-10-10 14:33:55 UTC
Confirmed with KDE 4.5.2
Comment 5 Thomas Lübking 2012-03-17 14:41:33 UTC
Sorry for the delay.

Fix (against kwin git master, but will likely apply on 4.8 as well)
https://git.reviewboard.kde.org/r/104316/

You need to activate an undocumented settings which will get a GUI in 4.9
kwriteconfig --file kwinrc --group Windows --key NextFocusPrefersMouse true
Comment 6 Thomas Lübking 2012-03-18 21:54:52 UTC
Git commit 724895e5355e27d0aff8b0eaf55d26c24efc32d3 by Thomas Lübking.
Committed on 17/03/2012 at 15:34.
Pushed by luebking into branch 'master'.

handle ungrab crossings for FFM & mouse preference
REVIEW: 104316

M  +5    -3    kwin/events.cpp

http://commits.kde.org/kde-workspace/724895e5355e27d0aff8b0eaf55d26c24efc32d3