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.
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.
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