Bug 495844 - Alt+tab with only Thumbnail Grid tabbox brings another window to front, but the focus remains on the first window
Summary: Alt+tab with only Thumbnail Grid tabbox brings another window to front, but t...
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: effects-tabbox (show other bugs)
Version: 6.2.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 496406 (view as bug list)
Depends on:
Blocks:
 
Reported: 2024-11-05 15:03 UTC by Branimir Amidzic
Modified: 2025-01-04 05:44 UTC (History)
8 users (show)

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


Attachments
Demonstration of reported issue (487.80 KB, video/x-matroska)
2024-11-05 15:03 UTC, Branimir Amidzic
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Branimir Amidzic 2024-11-05 15:03:05 UTC
Created attachment 175550 [details]
Demonstration of reported issue

SUMMARY
Since recently I've been experiencing *really* annoying issue with LibreOffice on my laptop.
If I have two LibreOffice documents open (tested with Calc and Writer) and if I use Alt+TAB to switch between documents/windows, the window focus is not consistent with the selected window.
For example, if I work in document 1 and use Alt+TAB to switch to document 2, the relevant window is put to front, but the focus remains on document 1. Any typing on the keyboard happens to background document 1.
Please see attached video.
I opened two Calc documents. Typed "1" and ENTER in "Untitled 2". Then, I switched to "Untitled 1" and typed "2" and ENTER. The number 2 appeared in document "Untitled 2" which was in the background.
After investigating I found out that this happens when "Thumbnail Grid" effect is selected in Settings -> Window Management -> Task Switcher. When I select some other effect I don't experience this issue any more.
I tried deleting ~/.config/libreoffice folder and it didn't help.

STEPS TO REPRODUCE
1. Open two Calc documents.
2. Type "1" in the first document.
3. Switch to the second document with Alt+TAB
4. Type "2" in the second document.

OBSERVED RESULT
The first document contains "1" and "2" in first two rows of column 1.
The second document contains nothing.

EXPECTED RESULT
The first document should contain "1", and the second document should contain "2".

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.6-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 12 × 12th Gen Intel® Core™ i5-1235U
Memory: 31,0 GiB of RAM
Graphics Processor: Mesa Intel® Graphics
Manufacturer: Dell Inc.
Product Name: Latitude 5530

ADDITIONAL INFORMATION
Bug reported to LibreOffice Bugzilla: https://bugs.documentfoundation.org/show_bug.cgi?id=163768
Comment 1 Nate Graham 2024-11-05 19:22:28 UTC
Interesting issue. When I follow the steps in your screen recording exactly, I can't make it happen, though. My system:

Operating System: Fedora Linux 41
KDE Plasma Version: 6.2.80
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.0
Kernel Version: 6.11.5-300.fc41.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 16 × AMD Ryzen 7 7840U w/ Radeon™ 780M Graphics
Memory: 14.9 GB of RAM
Graphics Processor: AMD Radeon 780M


Can you try again in a new clean user account on the same machine?
Comment 2 Branimir Amidzic 2024-11-05 19:53:45 UTC
Hello, Nate!

Yes, I can confirm it happens with newly created account.
I tried downgrading to v.24.8.0 and the issue is still present.

Regards!
Comment 3 Nate Graham 2024-11-06 18:39:06 UTC
That is extremely strange. Thanks for testing.
Comment 4 Buovjaga 2024-11-08 07:14:25 UTC
I've also noticed this and I remember accidental input into other applications than LibreOffice as a cause. Probably LibreOffice was involved in these cases as I'm always tinkering with it somehow. Especially bad is that keyboard shortcuts target the wrong window, so I might accidentally close a browser tab with unsubmitted text in a field.

Testing now per Branimir's steps, I can't reproduce exactly. I did initially get a behaviour where text input did not go *anywhere* after switching. Hitting arrow keys did grab focus into the expected Calc window after that. But after testing for a while, input started working fine and remained consistent. Quitting LibreOffice and retrying, I was again in the state where text input did not appear after switching. But let's set to confirmed per this result anyway.

Operating System: EndeavourOS [Arch Linux]
KDE Plasma Version: 6.2.2
KDE Frameworks Version: 6.7.0
Qt Version: 6.8.0
Kernel Version: 6.11.5-arch1-1 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i7-6700K CPU @ 4.00GHz
Memory: 31.2 GiB of RAM
Graphics Processor: Mesa Intel® HD Graphics 530

Version: 24.8.1.2 (X86_64) / LibreOffice Community
Build ID: 480(Build:2)
CPU threads: 8; OS: Linux 6.10; UI render: default; VCL: kf6 (cairo+wayland)
Locale: fi-FI (fi_FI.UTF-8); UI: en-US
24.8.1-1
Calc: threaded
Comment 5 Branimir Amidzic 2024-11-08 08:23:49 UTC
(In reply to Buovjaga from comment #4)
> I've also noticed this and I remember accidental input into other
> applications than LibreOffice as a cause.

Thanks for confirming.
Since you mentioned other apps, I noticed one problem with Dolphin. When I Alt+TAB to Dolphin window sometimes I can't grab the selected file (although it is selected). I need to press ESC, select it again and then I can grab it. I think that this problem is also gone now that I'm using "Compact" effect for Alt+TAB and not Thimbnail Grid as before.
Comment 6 Buovjaga 2024-11-08 09:13:27 UTC
Oops, I forgot to actually test after deactivating Thumbnail Grid and I still repro. Maybe I'll undo the confirmation then.
Comment 7 Branimir Amidzic 2024-11-08 20:33:16 UTC
Here's better demonstration involving two Calc windows and one Dolphin window (https://nextcloud.ambraspace.com/index.php/s/P85wZ7YjfrYi6Pa).
This was tested with completely new user account.

I also tried two AppImage versions:
Fresh, v.24.8.2.1
Still, v.24.2.7.2
and the issue also exists.
Comment 8 Buovjaga 2024-11-10 15:27:47 UTC
(In reply to Branimir Amidzic from comment #7)
> Here's better demonstration involving two Calc windows and one Dolphin
> window (https://nextcloud.ambraspace.com/index.php/s/P85wZ7YjfrYi6Pa).
> This was tested with completely new user account.

I do repro the issue of not being able to drag a file in Dolphin after Alt+Tabbing from LibreOffice, so I suppose I can set to confirmed.

A couple of days ago another KDE-using LibreOffice developer confirmed seeing this sort of Alt+Tab weirdness.
Comment 9 Kevin Fenzi 2024-11-17 00:12:49 UTC
I'm not sure if it's this same thing, but I am seeing alt-tab + thumbnail grid focus issues here on fedora rawhide ( kwin-6.2.3-1.fc42.x86_64 )

it's only thumnail grid, all the other visiulizations seem to handle focus fine.

Just hitting alt or some other key with the unfocused window up brings it into focus.
Comment 10 Nate Graham 2024-11-19 18:55:25 UTC
*** Bug 496406 has been marked as a duplicate of this bug. ***