Bug 341330 - Active terminal doesn't always gain focus correctly after opening the window
Summary: Active terminal doesn't always gain focus correctly after opening the window
Status: CONFIRMED
Alias: None
Product: yakuake
Classification: Applications
Component: general (show other bugs)
Version: Git (Frameworks 5)
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Eike Hein
URL:
Keywords:
: 343199 354646 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-27 18:06 UTC by Elias Probst
Modified: 2018-10-11 17:52 UTC (History)
17 users (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 Elias Probst 2014-11-27 18:06:33 UTC
When using kwin's "Focus follows mouse" (FSP: Low) focus policy, Yakuake will not properly gain the focus when invoking it.

How to reproduce:
1. Set 'Policy' to 'Focus follows mouse' (System Settings → Window Management → Window Behavior)
2. Move the mouse into the area where Yakuake will show up when invoking it
3. Trigger Yakuake (F12)

The way Yakuake doesn't get the focus is a bit weird.
When it is shown, it is possible to write something in the terminal, but using a shortcut (e.g. Ctrl+Shift+V) will only result in the control-sequence (^V) being written into the terminal.
Comment 1 Elias Probst 2015-01-11 02:21:36 UTC
The "focus type" Yakuake receives also simply changes when moving the cursor into the Yakuake window.

Every 2nd time it's the proper focus, while every other 2nd time it's the "broken" focus where shortcuts like Ctrl+Shift+V don't work.
So this can simply be tested by moving the cursor above and away from the Yakuake window repeatedly in kwin's "Focus follows mouse" mode.
Also notable: when the "wrong focus" is active, the cursor isn't shown as filled solid but only as an unfilled rectangle.
Comment 2 Eike Hein 2015-02-07 17:51:07 UTC
*** Bug 343199 has been marked as a duplicate of this bug. ***
Comment 3 Eike Hein 2015-02-07 17:52:03 UTC
Even without "Focus Follows Mouse", the terminal sometimes doesn't gain focus properly when the cursor is above the Yakuake window while it's opening.
Comment 4 Eike Hein 2015-03-06 22:13:28 UTC
FWIW, I spent a while tracking this through a bunch of layers of Qt code and landed within a mystery of how the xcb plugin handles window activation - still don't have any definitive answers though ...
Comment 5 Alexander Potashev 2015-06-24 04:37:25 UTC
(In reply to Eike Hein from comment #3)
> Even without "Focus Follows Mouse", the terminal sometimes doesn't gain
> focus properly when the cursor is above the Yakuake window while it's
> opening.

It's always the case for me, not just "sometimes":
 - when the mouse pointer is inside the region where Yakuake window would appear, the terminal doesn't gain focus (i.e. shortcuts don't work, cursor is drawn as an outline),
 - when the mouse pointer is outside the Yakuake window to be shown, the terminal always gains focus correctly.
Comment 6 Vadim A. Misbakh-Soloviov (mva) 2015-12-17 11:37:04 UTC
*** Bug 354646 has been marked as a duplicate of this bug. ***
Comment 7 Huon 2016-03-27 05:46:15 UTC
Unchecking "Ask the window manager to perform the animation" (in Configure -> Window) seems to have fixed this for me. FWIW I got the dodgy focus seemingly randomly, about 30% of the time. I did/do not have "Focus Follows Mouse" turned on.
Comment 8 Vadim A. Misbakh-Soloviov (mva) 2016-03-27 06:25:43 UTC
I can confirm this workaround.
Comment 9 Alexander Potashev 2016-03-27 08:23:41 UTC
(In reply to Huon from comment #7)
> Unchecking "Ask the window manager to perform the animation" (in Configure
> -> Window) seems to have fixed this for me.

Worked for me as well. Thanks a lot!
Comment 10 Mesheryakov Konstanitin 2016-03-27 09:26:10 UTC
This solution doesn't work for certain window managers, for intance, XMonad.
Comment 11 Eike Hein 2016-03-27 10:56:01 UTC
Well, on XMonad it always does what this workaround does. That said I don't think this is a real solution.
Comment 12 artephius 2016-03-27 20:19:21 UTC
I don't have focus follows mouse on and this still happens every other time or so...

I've found right clicking in the konsole window restores focus, though that is not really a workaround obviously.
Comment 13 Alessandro 2016-04-24 08:55:28 UTC
Same problem here; doesn't seem to depend on how the focus policy is configured; Huon's fix appears to be a good workaround.
Comment 14 Luis Lezcano Airaldi 2016-06-05 16:23:43 UTC
I can also confirm this bug. The workaround proposed also fixes the issue.

Arch Linux
Yakuake 3.0.2
KDE Frameworks 5.22.0
Qt 5.6.0
Comment 15 Valerii Malov 2016-07-16 13:35:43 UTC
Gentoo Linux
Kwin 4.11.22
Yakuake 3.0.2
Konsole 16.04.3
KDE Frameworks 5.24

I don't have "follow the mouse" focus policy, same symptoms as mentioned before, workaround helps

If I have mouse outside Yakuake when it shows up, it gains focus, but if I have multiple split terminals, after I hide/show Yakuake window multiple times, focus jumps to next split terminal.
Comment 16 Alexander Mentyu 2017-08-16 15:26:38 UTC
Not confirming this bug in Yakuake 3.0.4+

Qt Version: 5.9.1
Frameworks Version: 5.36.0
Operating System: Linux 4.9.40-1-MANJARO x86_64
Distribution: "Netrunner Rolling"
Comment 17 Grief 2018-10-11 17:41:34 UTC
On the latest plasma 5.14 and yakuake 3.0.5 the workaround mention above ("Ask the window manager to perform the animation") doesn't work anymore, pane focus got messed independently of is this option is turned on or off
Comment 18 Grief 2018-10-11 17:52:24 UTC
*** This bug has been confirmed by popular vote. ***