Bug 505431

Summary: Weird focus behavior after opening a file
Product: [Applications] kate Reporter: Antoine Pitrou <pitrou>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: waqar.17a
Priority: NOR    
Version First Reported In: 25.04.2   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Antoine Pitrou 2025-06-10 14:19:58 UTC
SUMMARY

After opening a file with Ctrl+O, the UI focus is in a weird state. If I type some characters, they get added into the newly opened file, but I can't navigate using arrow keys and the cursor doesn't blink. Other navigation features such as Ctrl+F don't work either.

(amusingly, pressing Tab does indent the file's first line, instead of switching the focus to the file!)

I therefore have to click into the editor area to be able to work on the file, which is annoying.

Also of note: the quick file open feature using Ctrl+Alt+O doesn't have this problem.

STEPS TO REPRODUCE

1. Open a file using Ctrl+O
2. Try navigating inside the file using arrow keys (or PgUp/PgDown, etc.)

OBSERVED RESULT

Nothing happens as the cursor doesn't move and doesn't even blink

EXPECTED RESULT

After a file is opened using Ctrl+O, it should be given focus so that the user can navigate through it using the keyboard.

SOFTWARE/OS VERSIONS

Using Kate 25.04.2 from the Ubuntu snap on 24.04, running on the XFCE desktop.

ADDITIONAL INFORMATION
Comment 1 Waqar Ahmed 2025-06-10 19:08:40 UTC
Can't reproduce on master. 

Can you try to disable some/all plugins and see if the issue goes away?
Comment 2 Antoine Pitrou 2025-06-11 06:03:29 UTC
I've disabled all plugins but it didn't fix the issue.

However, I've discovered that with QT_QPA_PLATFORMTHEME=gtk3, the bug disappears. With either QT_QPA_PLATFORMTHEME=gtk2 or QT_QPA_PLATFORMTHEME=qt5ct, the bug happens.
Comment 3 Waqar Ahmed 2025-06-13 06:27:56 UTC
I doubt we can do anything to fix this. I would suggest using Kate with Breeze/kde platform theme.