Bug 392426 - Change handling of detection of files modified by foreign processes
Summary: Change handling of detection of files modified by foreign processes
Status: RESOLVED FIXED
Alias: None
Product: kate
Classification: Applications
Component: application (show other bugs)
Version: 17.04.2
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-27 19:48 UTC by cat22
Modified: 2021-02-28 17:38 UTC (History)
5 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description cat22 2018-03-27 19:48:06 UTC
Currently if 'warn about files modified by foreign processes' is selected, kate prompts to reload a file every time it changes.
It would be better if you had an option to 'automatically reload files modified by foreign processes' (without a prompt each time) 
When i have a log file and some data files loaded in kate for review it gets really annoying to constantly be interrupted with the prompt to reload the file I am not currently viewing. 
In addition, kate steals the focus from the entire desktop when this prompt comes up so you HAVE to answer it.
Can this stuff be done on a per file basis somehow?
Comment 1 Peter J. Mello 2020-03-01 05:06:06 UTC
If I might weigh in on this issue...I came by intending to file a bug report very much like this one, and not knowing the dev team's preference in such instances, I'll err on the side of less clutter,

I confess that this behavior is currently my least favorite from Kate, though my concept of how it might be improved approached from a different angle. The fundamental logic behind it feels sound to me, only incomplete. What if the only change made to the existing dialog prompting a reaction to external modifications was an optional drop down function from the ignore button that offered the ability to:
  A) Ignore changes to that file for the remainder of the session and warn only on an attempt to save the file
  B) Ignore for n minutes (I picture this as being a nested menu inside the drop-down, with a submenu of natural intervals measured in minutes)
  C) Lock out all inputs and refresh without confirmation (admittedly this one is more radical than the first two, I include it merely to illustrate the range of relatively foreseeable user desires)

That's all I've got. You guys have really been killing it lately, IMO. Not to say that Kate hasn't always been quality software, but speaking candidly, prior to last year it was relegated mostly to the random occasions Dolphin didn't have a default for SublimeText3 or VSCode for whatever MIMEType I was opening. I'm bad with version numbers but at some point this summer, I realized I was burning an awful lot of mouse clicks on "Open With... -> Kate" and began flipping those default handlers over to Kate and haven't looked back. I was gonna lead off with this sentiment but I worried it might cheapen my suggestion if it seemed I was trying to butter your bread first.

Sorry for rambling; I look forward to any responses that may be forthcoming.

-Peter
Comment 2 Justin Zobel 2020-11-13 05:11:07 UTC
I've just tested and kate does not steal focus now. It waits until it has focus to check if the file has changed.

As for it ignoring changes without it grabbing focus I can't see this being a huge inconvenience.

Can you please test and confirm if this issue is still occurring or if this bug report can be marked as resolved. I'm setting status to "needsinfo" pending your response, please change back to "reported" or "resolved" when you respond, thanks.
Comment 3 Justin Zobel 2020-11-13 05:11:35 UTC
Note: I just looked and the notification comes up with an Enable Auto Reload option so that should solve this issue.
Comment 4 cat22 2020-11-13 12:45:49 UTC
in Kate 20.04.2 if i enable "Warn about files modified by foreign processes"
and then go to a konsole terminal and modify a file that's opened in kate (with kate behind the konsole window), kate immediately moves to the foreground with the warning dialog open.
20.04.2 is all i have access to without compiling and reinstalling.
What is the version this is fixed in?

With the above turned off, if I then select auto-reload from the menu and repeat the file modification thing like before - the file is auto reloaded and no focus stealing or dialog occurs. <= this is good! It lets me watch log files.
Comment 5 Bug Janitor Service 2020-11-28 04:33:45 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 6 cat22 2020-11-28 15:22:50 UTC
See my prev comment
Comment 7 Marcell Fulop 2021-02-22 09:43:48 UTC
Hi @cat22,

There was another thread about this, I cannot find it now. There I commented something like: When the 'warn about file changes' setting is turned on, you can still make kate stay in the background by setting focus stealing prevention to high in window behaviour setting.

When the setting is not turned on, you still get notified about externally modified files in the in document notification area (message). There you have the option to turn on auto-reoad.
Comment 8 Bug Janitor Service 2021-02-26 13:27:45 UTC
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kate/-/merge_requests/293
Comment 9 Jan Paul Batrina 2021-02-26 13:54:06 UTC
@cat22 @Peter J. Mello I think the non-dialog warning that Kate uses by default addresses your problems with the dialog. You can try it by disabling the "Warn about files modified by foreign processes" (which is currently a bit misleading). It only shows when you keybord/mouse focus is given to the modified file and, as previously mentioned above, has an "Enable Auto Reload" option.
Comment 10 cat22 2021-02-28 14:19:09 UTC
I think this can be closed because the behavior i reported is not happening 3 years hence and kate works as I would expect it to.
Thanks -