Bug 353712 - Warn about files modified by foreign processes steals focus
Summary: Warn about files modified by foreign processes steals focus
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 5.0.0
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-10-09 10:11 UTC by Nikola Kovacs
Modified: 2022-01-22 13:52 UTC (History)
7 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Nikola Kovacs 2015-10-09 10:11:39 UTC
The help text for this option says:

"If enabled, when Kate receives focus..."

But instead kate steals focus immediately when a file is modified by another process. This is very annoying.

(Sometimes it just reloads a file without asking, but I can't figure out why. If the file has unsaved changes, it will always ask of course)

Reproducible: Always

Steps to Reproduce:
1. Turn on "Warn about files modified by foreign processes"
2. Create a file and save it.
3. Modify the file, but don't save it.
4. Open another editor, modify the file, and save it.

Actual Results:  
Kate will immediately detect the modification and pop up the dialog asking you what you want to do.

Expected Results:  
Kate waits until it gets focus to pop up the dialog.

Using frameworks 5.12.0 on Kubuntu 15.04
Comment 1 Dominik Haumann 2016-09-07 20:34:17 UTC
Git commit 0e299055c5c89f76a2301a2dde41214216e6066a by Dominik Haumann.
Committed on 07/09/2016 at 20:34.
Pushed by dhaumann into branch 'master'.

Use non-modal message widget for externally modified file notifications

No more modal dialogs for externally modified changes that can
acidentally be pressed while typing.

For Kate, nothing changes if you have "[x] Warn about files modified
by foreign processes" enabled.

Differential Revision: D2700

Fixed-In: KDE Frameworks 5.27
Related: bug 309493, bug 351932

M  +0    -1    src/CMakeLists.txt
M  +47   -123  src/dialogs/katedialogs.cpp
M  +12   -12   src/dialogs/katedialogs.h
M  +62   -70   src/document/katedocument.cpp
M  +9    -5    src/document/katedocument.h
M  +0    -8    src/view/kateviewinternal.cpp

http://commits.kde.org/ktexteditor/0e299055c5c89f76a2301a2dde41214216e6066a
Comment 2 Christoph Cullmann 2018-08-17 19:56:56 UTC
Still that way if the "warn about files..." checkbox is on.
Comment 3 Patrick Silva 2019-03-29 14:55:16 UTC
This behavior persists with kate 18.12.3 on Arch Linux.

Operating System: Arch Linux 
KDE Plasma Version: 5.15.3
KDE Frameworks Version: 5.56.0
Qt Version: 5.12.2
Comment 4 Lothar 2019-03-30 07:58:45 UTC
Isn't this option nowadays obsolete/dispensable? 
You will be informed by the fancy in view hint about a modification when you focus the document.
Comment 5 Justin Zobel 2020-10-25 07:25:13 UTC
This is still an issue in Kate 20.08.1. I get this happen to me often. Kate should not take focus away from what I'm doing in other windows.
Comment 6 Marcell Fulop 2021-02-19 12:25:09 UTC
When the "Focus stealing prevention" is set to "High" (System Settings -> Window Management -> Window Behaviour -> Focus tab), it doesn't happen.

When this warning is turned off in Kate, you still get notified about the file change, when Kate gets focussed, in the notification bubble between the editor and the tab bar.

So when focus stealing prevention in this case is that important for a user, there are these two options to get around. Which makes me consider this as not a bug at all.
Comment 7 Bug Janitor Service 2021-02-26 13:27:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/293
Comment 8 Christoph Cullmann 2021-03-02 13:01:57 UTC
Git commit 532c0bab6339387993844989065b366d17744498 by Christoph Cullmann, on behalf of Jan Paul Batrina.
Committed on 02/03/2021 at 13:01.
Pushed by cullmann into branch 'master'.

Use a more explicit description for the modified files dialog option

The previous text implied that disabling the option will result into
no warnings for files modified by foreign processes.
GUI:

M  +4    -5    kate/kateconfigdialog.cpp

https://invent.kde.org/utilities/kate/commit/532c0bab6339387993844989065b366d17744498
Comment 9 Bug Janitor Service 2022-01-22 13:02:28 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/572
Comment 10 Christoph Cullmann 2022-01-22 13:52:04 UTC
Git commit 3e8defff5349245167a64fadb0e202644f723ac2 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 22/01/2022 at 13:47.
Pushed by cullmann into branch 'master'.

Dont bring kate to front when files externally modified

If you have the following setting checked:

[x] Warn about files modified by foreign processes

Then kate will activate the app and bring it to front interrupting any
other work that you might have been doing. This is very annoying and
makes this option very hard to use.

M  +29   -0    kate/katemainwindow.cpp
M  +10   -0    kate/katemwmodonhddialog.h

https://invent.kde.org/utilities/kate/commit/3e8defff5349245167a64fadb0e202644f723ac2