Bug 455228 - focus follows mouse thwarted by libreoffice
Summary: focus follows mouse thwarted by libreoffice
Status: RESOLVED UPSTREAM
Alias: None
Product: kwin
Classification: Plasma
Component: core (show other bugs)
Version: 5.24.4
Platform: Fedora RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-06-13 22:15 UTC by Éric Brunet
Modified: 2024-06-09 16:15 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
A simple LibreOffice Calc demonstrating the problem (8.16 KB, application/vnd.oasis.opendocument.spreadsheet)
2022-06-13 22:15 UTC, Éric Brunet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Éric Brunet 2022-06-13 22:15:44 UTC
Created attachment 149671 [details]
A simple LibreOffice Calc demonstrating the problem

I am running an uptodate fedora 35, with KDE and Xorg.

kwin is configured with "focus follows mouse", and it usually works.

However, a certain manipulation with libreoffice Calc can lock the focus on libreoffice Calc's window.

In detail, one can specify a list of valid values for some cells in LibreOffice Calc. In the attached file BugFocus.ods file, the only valid valued for cell A1 are "emacs" and "vim". When clicking on cell A1, a down arrow appears on the right of the cell. When clicking on the arrow, a drop-down menu appears to choose one of these values. If one chooses a value (and don't click anywhere else), then the focus is locked to LibreOffice Calc. In particular, even after moving the cursor out of LibreOffice's windows, mouse scroll events and keyboard events are directed to LibreOffice. A mouse click event is first sent to LibreOffice, but breaks the lock and gives the focus to the window under the cursor.

I tried all the possible settings for kwin's focus policy (in particular I tried "extreme focus stealing prevention"), but it doesn't help.

I don't know what horrible thing LibreOffice is doing, but focus stealing prevention is kwin's job.
Comment 1 Éric Brunet 2022-06-16 21:09:31 UTC
Today, I managed to reproduce this bug on a different computer also running XOrg. I also tried to reproduce it on that same computer but with wayland, but I couldn't.

So, the bug only happens with XOrg.
Comment 2 Zamundaaa 2024-06-09 16:15:06 UTC
This sounds like LibreOffice is grabbing the input events for some reason, which it can only do on Xorg. If you can still reproduce this issue, please report it to LibreOffice