Discussion:
[plasmashell] [Bug 400987] New: XWayland application focus breaks
Add Reply
Brian
2018-11-13 00:02:40 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

Bug ID: 400987
Summary: XWayland application focus breaks
Product: plasmashell
Version: master
Platform: Neon Packages
OS: Linux
Status: REPORTED
Severity: normal
Priority: NOR
Component: generic-wayland
Assignee: plasma-***@kde.org
Reporter: ***@gmail.com
Target Milestone: 1.0

SUMMARY

From time to time within applications using XWayland, the window focus will
break and it will be impossible to interact with the window anymore. This often
occurs when you right click within the application or when you minimize the
application and then restore it later. (When this problem occurs it also seems
to cause current, or later right clicks to not register, requiring to you
either logout, or try to minimize/restore the window a couple times until it
decides to start working again)

This problem occurs even if you don't have a second monitor, however it seems
to effect secondary monitors more so.


STEPS TO REPRODUCE
1. Run a xwayland application (Firefox, Chromium, Spotify, Discord,
Thunderbird)
2. Minimize it to the task bar, Restore it
3. If it doesn't loose focus, do it a few more times. You can also try right
clicking, especially within Firefox (v63) (The behavior is seemingly random)

OBSERVED RESULT

Windows will no longer detect input you give them, but are still seemingly
focused in regards to the window Titlebar.


EXPECTED RESULT

Right clicks register and display their menus, Text is detected, Mouse clicks
are recorded at all times.


SOFTWARE/OS VERSIONS

Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.14.80 (5.12, 5.13, 5.14)
Qt Version: 5.11.2
KDE Frameworks Version: 5.53.0
Kernel Version: 4.19.1-041901-generic
OS Type: 64-bit
Processors: 8 × Intel® Core™ i7-4790 CPU @ 3.60GHz
Memory: 15.6 GiB of RAM


ADDITIONAL INFORMATION

From the testing I've done, all plasma versions from at least (didn't test
further than that) 5.12 and up are affected.

This is the Reddit post i made a few days ago, which someone has replied to
saying that they encounter this when using applications in their second
monitor:
https://www.reddit.com/r/kde/comments/9vd65y/wayland_application_focus_and_multimonitor_bugs/
--
You are receiving this mail because:
You are watching all bug changes.
Patrick Silva
2018-11-13 10:29:24 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

Patrick Silva <***@gmx.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmx.com

--- Comment #1 from Patrick Silva <***@gmx.com> ---
I have the same problem on my system.

Operating System: Arch inux
KDE Plasma Version: 5.14.3
Qt Version: 5.12 beta4
KDE Frameworks Version: 5.52
--
You are receiving this mail because:
You are watching all bug changes.
David Edmundson
2018-11-13 12:33:53 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

David Edmundson <***@davidedmundson.co.uk> changed:

What |Removed |Added
----------------------------------------------------------------------------
Product|plasmashell |kwin
Target Milestone|1.0 |---
CC| |***@davidedmundson.co.uk
Component|generic-wayland |core
Assignee|plasma-***@kde.org |kwin-bugs-***@kde.org
Version|master |unspecified
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-11-17 07:38:01 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #2 from Martin Flöser <***@kde.org> ---
What exactly do you mean with "loose focus"?
--
You are receiving this mail because:
You are watching all bug changes.
Méven Car
2018-11-17 10:25:16 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

Méven Car <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #3 from Méven Car <***@gmail.com> ---
I have encountered the issue with firefox since it is the most common xwayland
app I use.

I believe here "Loosing focus" means no mouse input work : you click on the
window but the window does not react accordingly.

In my experience I could use the keyboard though. For instance in firefox I
could use Ctrl + Tab to switch tabs.
--
You are receiving this mail because:
You are watching all bug changes.
Bhushan Shah
2018-11-17 18:00:31 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

Bhushan Shah <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
Ever confirmed|0 |1
CC| |***@gmail.com
Status|REPORTED |CONFIRMED

--- Comment #4 from Bhushan Shah <***@gmail.com> ---
I can reproduce this issue, at a time that I thought this would be hard are
issue.

I don't exactly know pattern to reproduce this but yes this is annoying.
--
You are receiving this mail because:
You are watching all bug changes.
Bhushan Shah
2018-11-17 18:00:55 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #5 from Bhushan Shah <***@gmail.com> ---
*hardware
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-11-17 19:49:51 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #6 from Martin Flöser <***@kde.org> ---
I cannot reproduce and have not encountered the problem.
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-11-18 04:05:28 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

***@airmail.cc changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@airmail.cc

--- Comment #7 from ***@airmail.cc ---
Same. Can't reproduce but I'll try to describe as much as I can.

Last time this happened I was using Sublime Text 3 and my VM was in the
background. I tried to close a file and a modal from ST3 showed up (Save
changes to New file before closing?). It quickly vanished and my clicks stopped
working. I tried to alt+tab to find the second window and I also checked if
they were behind other windows, it just vanished.

When I was using alt+tab I noticed that on top of my virtual machine (top left
corner) I could see the vanished modal with a black background but it wasn't
functional, more like a glitch.

Maybe a good candidate to trigger this bug is to open a Windows 10 VirtualBox
machine with 3D acceleration enabled (but that might skew the results since it
should be off afaik), switch to full screen mode and try to use the host OS.


SOFTWARE/OS VERSIONS
Operating System: Kubuntu 18.10
PPA: kubuntu-ppa/backports
KDE Plasma Version: 5.14.3
Qt Version: 5.11.1
KDE Frameworks Version: 5.51.0
Kernel Version: 4.18.0-11-generic
OS Type: 64-bit
Plasma Wayland session, Intel iGPU only

Virtualbox 5.2.18_Ubuntu r123745, mouse integration enabled

Behavior observed when any of my vms were open:
- Windows 10 guest, 3D Off, 2D On (256MB)
- Linux guests, 3D and 2D off
--
You are receiving this mail because:
You are watching all bug changes.
Brian
2018-11-18 07:07:18 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #8 from Brian <***@gmail.com> ---
(In reply to Martin Flöser from comment #6)
Post by Martin Flöser
I cannot reproduce and have not encountered the problem.
That's weird. Yeah, the problem is that the Xwayland application looses focus
after a while... I'll see if i can record it, it's extremely random, but it
really breaks the workflow when it keeps re-occurring.
--
You are receiving this mail because:
You are watching all bug changes.
Alexander Mentyu
2018-11-18 16:01:05 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

Alexander Mentyu <***@gmail.com> changed:

What |Removed |Added
----------------------------------------------------------------------------
CC| |***@gmail.com

--- Comment #9 from Alexander Mentyu <***@gmail.com> ---
Was able to reproduce not responsive to mouse clicks Telegram window once in
multi-monitor setup - one above other with panel on upper external 24" 1440p
monitor and Telegram window on lower 14" 1080p laptop monitor

Telegram 1.4.3 install through snap
Operating System: KDE neon Developer Edition
KDE Plasma Version: 5.14.80
KDE Frameworks Version: 5.53.0
Qt Version: 5.11.2
Kernel Version: 4.15.0-39-generic
--
You are receiving this mail because:
You are watching all bug changes.
Brian
2018-11-18 17:37:58 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #10 from Brian <***@gmail.com> ---
I was able to reproduce it with a single monitor again today. Sorry for the bad
quality, my phone's camera does not have stabilization and i compressed the
video a bit to save space.

https://drive.google.com/open?id=1KQuJ8t8V50EkjJnUOvBR_D4yzMf7z2Yh
--
You are receiving this mail because:
You are watching all bug changes.
Patrick Silva
2018-11-18 18:56:17 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #11 from Patrick Silva <***@gmx.com> ---
Today it happened twice on my system with VLC player.
VLC was playing a video in background, I switched from another app (kate and
ksysguard) to VLC, VLC appeared on the screen with frozen video while audio was
playing normally. Nothing happened when I clicked on VLC until I minimized and
restored its window, then the video unfroze and mouse clicks worked again.

Operating System: Arch Linux
KDE Plasma Version: 5.14.3
Qt Version: 5.12.0 beta4
KDE Frameworks Version: 5.52.0
Kernel Version: 4.19.2-arch1-1-ARCH
--
You are receiving this mail because:
You are watching all bug changes.
Martin Flöser
2018-11-18 19:28:41 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #12 from Martin Flöser <***@kde.org> ---
To anybody encountering the problem: please go to Compositor settings and
change "Keep window thumbnails" to "Always". That's the setting I have and
which could explain why I don't see the problem.

If you can confirm that this fixes the problem we can remove the setting and
enforce it on Wayland. The setting doesn't really make sense on Wayland, that's
why I have set it to Always.
--
You are receiving this mail because:
You are watching all bug changes.
Patrick Silva
2018-11-18 19:44:40 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #13 from Patrick Silva <***@gmx.com> ---
I just found a way to reproduce:

open Firefox and unmaximize its window
move Firefox window near to plasma panel
right click your wallpaper on the space between Firefox and plasma panel
while context menu is open, click Firefox entry in plasma panel (context menu
closes)
click Firefox entry in plasma panel again (Firefox is minimized)
click Firefox entry again to restore it
Now mouse clicks on Firefox window have no effect

I can't reproduce after set "Keep window thumbnails" to "Always" in compositor
settings.

Wayland session crashed here when I configured "Keep window thumbnails" to
"Always". Is this a know problem?
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-11-18 23:19:22 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #14 from ***@airmail.cc ---
(In reply to Martin Flöser from comment #12)
Post by Martin Flöser
To anybody encountering the problem: please go to Compositor settings and
change "Keep window thumbnails" to "Always". That's the setting I have and
which could explain why I don't see the problem.
I did and had to reboot, some UI elements went black.
Post by Martin Flöser
If you can confirm that this fixes the problem we can remove the setting and
enforce it on Wayland. The setting doesn't really make sense on Wayland,
that's why I have set it to Always.
It's been a few hours and I haven't encountered the bug so far. It most
definitely helped (probably fixed it but I need to use the system for a few
days).

P.S.: VirtualBox's fullscreen mode is broken for me (accel on or off) and it
looks exactly like this bug where mouse clicks stop working in the host or
guest system. I'm not sure it's related or just something not implemented yet.
I thought I should mention it.
--
You are receiving this mail because:
You are watching all bug changes.
Brian
2018-11-20 04:57:09 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #15 from Brian <***@gmail.com> ---
I'm not sure if changing the setting caused this, or if it's a separate bug,
but for me the focus issue alot worse (it now seems to persist after going back
to the original settings). Sometimes when i click a element in a application,
the window isn't even focused now, and it clicks through the window (Both xorg
and wayland). This is really, really weird.
--
You are receiving this mail because:
You are watching all bug changes.
b***@kde.org
2018-11-20 16:48:44 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #16 from ***@airmail.cc ---
Update: I haven't experience the bug again so far, it's very likely fixed with
the suggested workaround.

--

For people still having trouble with VirtualBox:
If after the workaround you still have the bug in certain machines you can fix
it by installing guest additions. The problem is it won't work until you edit
the machine and make the window bigger, it triggers something I'm not aware
(probably the same as resizing in the GUI but I can't click that so). Close
virtualbox before editing the .vbox file.

<ExtraData>
<ExtraDataItem name="GUI/LastGuestSizeHint" value="1920,900"/>
<ExtraDataItem name="GUI/LastNormalWindowPosition"
value="680,-17,640,480,max"/>
</ExtraData>

This worked for me even for a pure server guest with no X and no 3d.
--
You are receiving this mail because:
You are watching all bug changes.
Méven Car
2018-11-20 20:52:02 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #17 from Méven Car <***@gmail.com> ---
I found a working reproducing method.

I have a two screens setup a 2560x1440 and 1280x1024.

My main screen is the biggest one on the left of the other one.

Whenever I move a xwayland app to the right screen from the left one, the
window becomes unresponsive to clicks and keyboard.
I get a weird behavior:
when I click on the window or use the scroll wheel a xwayland window on the
other screen gets clicked and scrolled and the current xwayland window
flickers. Except the position of those clicks on the other window are not
right.
Meanwhile at each click, The taskbar shows me that the window focus is changed
from the not-working window to the one on the other screen. Depending on this
focus, the keyboard input follows from one window to the other.

Sometimes this behavior appears spontaneously for a window that did not change
of screen.

It works with vlc, spotify, firefox.

Kubuntu 18.10
Linux 4.18.0-11-generic
KDE Frameworks 5.52.0
Qt 5.11.1
lspci | grep VGA
07:00.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI]
Baffin [Radeon RX 550 640SP / RX 560/560X] (rev cf)glxinfo | grep OpenGL
OpenGL vendor string: X.Org
OpenGL renderer string: Radeon RX 560 Series (POLARIS11, DRM 3.26.0,
4.18.0-11-generic, LLVM 7.0.0)
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.2

I can add more details if needed.

I hope this helps !
--
You are receiving this mail because:
You are watching all bug changes.
Brian
2018-12-07 00:32:49 UTC
Reply
Permalink
https://bugs.kde.org/show_bug.cgi?id=400987

--- Comment #18 from Brian <***@gmail.com> ---
Same graphics processor i have (Gigabyte RX 560 4GB OC). Perhaps it's related?
--
You are receiving this mail because:
You are watching all bug changes.
Loading...