Bug 497803 - On X11, minimizing Dolphin and then Alt-Tabbing back in focuses the Places panel instead of the files view
Summary: On X11, minimizing Dolphin and then Alt-Tabbing back in focuses the Places pa...
Status: RESOLVED FIXED
Alias: None
Product: dolphin
Classification: Applications
Component: general (show other bugs)
Version: 24.12.0
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-12-23 00:53 UTC by Riku
Modified: 2025-01-06 16:44 UTC (History)
3 users (show)

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


Attachments
Demonstration (3.21 MB, video/mp4)
2025-01-02 04:27 UTC, Riku
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Riku 2024-12-23 00:53:18 UTC
SUMMARY
Tabbing into dolphin after it had been minimized puts the places panel in focus instead of the files themselves. I tend to navigate with a keyboard by typing the directory/file names so this has been quite aggravating.
As a workaround you can just not minimize the window or hide the places panel.

STEPS TO REPRODUCE
1. Minimize dolphin
2. Tab back in
3. Type something

OBSERVED RESULT
After the window is raised the places panel steals focus and eats your input.

EXPECTED RESULT
Focus should be on the files.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux 
KDE Plasma Version: 6.2.4
KDE Frameworks Version: 6.9.0
Qt Version: 6.8.1
Graphics Platform: X11
Comment 1 John Kizer 2025-01-02 03:35:58 UTC
Hi - I can't reproduce the observed result using those steps on my Fedora KDE 41 system. Are you able to attach a screen recording (which can be created using Spectacle) of the behavior occurring on your device, to help folks see the specific timing and Dolphin layout involved?

Could you also check to see if this behavior occurs on a Wayland session?

Thanks!
Comment 2 Riku 2025-01-02 04:27:50 UTC
Created attachment 177027 [details]
Demonstration

Looks like this only happens on X11.
Comment 3 John Kizer 2025-01-02 05:27:13 UTC
Thanks!
Comment 4 Felix Ernst 2025-01-02 23:40:33 UTC
I wonder if I caused this with https://invent.kde.org/system/dolphin/-/commit/f220e3b0783a24a6c7195f170297cf4b12a29d85. The places panel might receive spontaneous visibility changed events and interpret those as being actively toggled visible.
Comment 5 Bug Janitor Service 2025-01-04 18:04:08 UTC
A possibly relevant merge request was started @ https://invent.kde.org/system/dolphin/-/merge_requests/882
Comment 6 Felix Ernst 2025-01-06 15:17:18 UTC
Git commit bfeeb46c3ae0b6e933b0381cc10eebad38a2b8c0 by Felix Ernst, on behalf of Felix Ernst.
Committed on 06/01/2025 at 15:09.
Pushed by felixernst into branch 'master'.

Fix focus changing when unminimising on X11

In f220e3b0783a24a6c7195f170297cf4b12a29d85 I made the keyboard
focus move to the places and terminal panel whenever they are
toggled visible. Unfortunately the QDockWidget::visibilityChanged()
signal is also emitted (at least on X11) simply when the window
containing that panel is minimized or restored. This commit
overrides the QDockWidget::event() method to ignore such
spontaneous show or hide events so QDockWidget won't emit the
visibilityChanged() signal then.

M  +17   -0    src/dolphindockwidget.cpp
M  +6    -0    src/dolphindockwidget.h

https://invent.kde.org/system/dolphin/-/commit/bfeeb46c3ae0b6e933b0381cc10eebad38a2b8c0
Comment 7 Felix Ernst 2025-01-06 15:48:05 UTC
Git commit a57ffc9f1ece7cf196691ec878383bcc20903da7 by Felix Ernst, on behalf of Felix Ernst.
Committed on 06/01/2025 at 15:17.
Pushed by felixernst into branch 'release/24.12'.

Fix focus changing when unminimising on X11

In f220e3b0783a24a6c7195f170297cf4b12a29d85 I made the keyboard
focus move to the places and terminal panel whenever they are
toggled visible. Unfortunately the QDockWidget::visibilityChanged()
signal is also emitted (at least on X11) simply when the window
containing that panel is minimized or restored. This commit
overrides the QDockWidget::event() method to ignore such
spontaneous show or hide events so QDockWidget won't emit the
visibilityChanged() signal then.


(cherry picked from commit bfeeb46c3ae0b6e933b0381cc10eebad38a2b8c0)

Co-authored-by: Felix Ernst <felixernst@zohomail.eu>

M  +17   -0    src/dolphindockwidget.cpp
M  +6    -0    src/dolphindockwidget.h

https://invent.kde.org/system/dolphin/-/commit/a57ffc9f1ece7cf196691ec878383bcc20903da7