how to stop leo stealing focus when file changes outside leo

79 views
Skip to first unread message

nic cave-lynch

unread,
Sep 13, 2023, 6:29:14 PM9/13/23
to leo-editor
Hi
Subject says it all, really. 
doing something like a `git stash` in a console window on a file that's controlled by Leo causes Leo to show the 'this has changed outside leo' dialog. That's fine, except the dialog steals focus, which is ... tedious. 
I've tried looking through the code to find where that happens, but with no success.
Any hints would be welcome.
Thanks
Nic

Edward K. Ream

unread,
Sep 14, 2023, 8:10:02 AM9/14/23
to leo-editor
On Wednesday, September 13, 2023 at 5:29:14 PM UTC-5 nic cave-lynch wrote:

doing something like a `git stash` in a console window on a file that's controlled by Leo causes Leo to show the 'this has changed outside leo' dialog. That's fine, except the dialog steals focus, which is ... tedious. 
I've tried looking through the code to find where that happens, but with no success.
Any hints would be welcome.

Focus issues are notoriously complicated.  I usually exit Leo whenever I am about to change branches.

Can you describe in detail what the "before" and "after" focuses are? I can then create a new Leo issue.

Edward

nic cave-lynch

unread,
Sep 17, 2023, 10:17:45 PM9/17/23
to leo-editor
before git stash save (or whatever), focus is in console window. After git stash save, leo takes focus with the 'something has change outside leo' dialog.
I'm happy for the dialog to appear, but I'd really rather it did not take focus away from the console window that I'm working in

HaveF HaveF

unread,
Sep 18, 2023, 7:52:31 PM9/18/23
to leo-editor

before git stash save (or whatever), focus is in console window. After git stash save, leo takes focus with the 'something has change outside leo' dialog.
I'm happy for the dialog to appear, but I'd really rather it did not take focus away from the console window that I'm working in

In this scenario, it sounds a bit annoying.

- Maybe an option to `refresh quiet` would be better? After all, in the context of Git, everything is already tracked.

- Or like the browser, there is a back function, it would be better to go back to the previous page/view?

 

Edward K. Ream

unread,
Oct 9, 2023, 3:55:41 PM10/9/23
to leo-editor
On Wednesday, September 13, 2023 at 5:29:14 PM UTC-5 nic cave-lynch wrote:

Subject says it all, really. 

I have just created #3601.

The issue just bit me as I was testing PR #3597. This was good luck. The PR defines two helper functions that should help solve the problem. Plus I know how to test any proposed fix ;-)

Edward
Reply all
Reply to author
Forward
0 new messages