Lightroom Classic: Synchronize Folder - Escape

  • 1
  • Problem
  • Updated 3 months ago
  • (Edited)
[Here's a recipe that reliably reproduces the bug: 
https://feedback.photoshop.com/photoshop_family/topics/synchronize-folder-escape?topic-reply-list[se...]

A tiny, simple one. Choose "Synchronize Folder". A dialog box comes up. Change your mind (perhaps there is nothing to synchronize). Hit "escape". Nothing happens, even though there is a "Cancel" button. So you have to use the mouse. 

One of many tiny usability issues.
Photo of Erich Schlaikjer

Erich Schlaikjer

  • 41 Posts
  • 7 Reply Likes
  • keyed up

Posted 3 months ago

  • 1
Photo of Sunil Bhaskaran

Sunil Bhaskaran, Official Rep

  • 486 Posts
  • 178 Reply Likes
Thanks for the feedback.
We will investigate.

Thanks,
Sunil
Photo of Robert Somrak

Robert Somrak, Champion

  • 724 Posts
  • 227 Reply Likes
ESC works for me on MacOS 10.14.6 and Lr 9.2
Photo of Erich Schlaikjer

Erich Schlaikjer

  • 41 Posts
  • 7 Reply Likes
This is on Windows 10. LR 9.2

It is like the dialog box does not have the focus. If I type any key I get a warning sound. 

OTOH, if I change one of the checkboxes with the mouse, then the dialog acquires the focus, and "escape" works.

Just clicking on the dialog box does not give it the focus, I have to click on one of the checkboxes and change its state.
Photo of John R. Ellis

John R. Ellis, Champion

  • 5129 Posts
  • 1453 Reply Likes
Escape works correctly in my LR 9.2 / Windows 10.  Try resetting LR's preferences: https://www.lightroomqueen.com/articles-page/how-do-i-reset-lightrooms-preferences/. LR sometimes soils its preferences file, and resetting it can fix all sorts of wonky behavior.
Photo of Erich Schlaikjer

Erich Schlaikjer

  • 41 Posts
  • 7 Reply Likes
I deleted the preferences file, but my problem persists, unfortunately.
Photo of Erich Schlaikjer

Erich Schlaikjer

  • 41 Posts
  • 7 Reply Likes
So I dredged up memories from decades ago to write a Windows app to show which window has the focus, using a timer. It has to do some nonsense like attaching to the current active window's thread.

First the focus is owned by my little Windows app:
Focus window is 0020066C ("WhatFocus"); Active window is 0020066C ("WhatFocus")

Then I select Lightroom Classic:
Focus window is 00010B20 ("(Bridge View)"); Active window is 00010878 ("Lightroom Catalog-2 - Adobe Photoshop Lightroom Classic - Library")

Then I right-click on a folder and choose "Synchronise":
Focus window is 00000000 (""); Active window is 000A0848 ("Synchronize Folder “2020-01-03”")

Then I uncheck a checkbox inside the Synchronise dialog box:
Focus window is 00051702 ("Scan for metadata updates"); Active window is 000A0848 ("Synchronize Folder “2020-01-03”")

Then I dismiss the dialog box:
Focus window is 00010B20 ("(Bridge View)"); Active window is 00010878 ("Lightroom Catalog-2 - Adobe Photoshop Lightroom Classic - Library")

So *nothing* has the focus after I choose "Synchronise". Weird.
Photo of John R. Ellis

John R. Ellis, Champion

  • 5129 Posts
  • 1453 Reply Likes
Since focus remains with Synchronize Folder on my Windows 10 installation, I wonder if your computer has a utility running in background that's unintentionally interfering with focus.  You could try rebooting in safe mode and seeing if it stills happens.
Photo of John R. Ellis

John R. Ellis, Champion

  • 5129 Posts
  • 1453 Reply Likes
Also, does the problem occur with other dialogs, e.g. right-click a collection and do Create Collection?
Photo of Erich Schlaikjer

Erich Schlaikjer

  • 41 Posts
  • 7 Reply Likes
I tried it on my laptop. Same problem. 
Then, no problem.
I noticed the difference: directory levels.
If I synch "My Pictures\2020", no focus problem.
If I synch "My Pictures\2020\2020-01-01", focus problem!
Happens reliably.

But I don't think it is the directory levels per se. As so often in LR, it is about speed and the sort-of-asynchronous Lua GUI.

If I try synchronising a third-level directory with enough files in it, then the focus will behave properly. I think the dialog is happy if it finishes initialising *before* the synch process has counted all the files.

While I was writing my little Windows app, I wandered down memory lane in the online Microsoft C++ API documentation. The examples that don't even compile -- still there! It is nice that some things stay the same forever. But I also came across a document about initialising dialogs. During the initialisation message, or returning from it, a program is supposed to say which widget inside the dialog gets the focus. I am guessing that LR does this correctly through a code path where the counting does not finish before returning from dialog-init, but incorrectly otherwise.

I have no idea how LR makes the GUI asynchronous. Does it use multiple GUI threads? Does it have multiple message loops? It's clever in concept, but buggy in execution, maybe inevitably so.

Other places where I hate this asynch feature include grid mode, where I might hit "delete" followed by "right arrow". LR will offer to delete the photo to the right, as if I had reversed the keystrokes. Selection happens asynchronously with the delete-key processing. This is not what most humans expect, I'll wager.

If your computer is slow, you may never see this bug.

For completeness, this is the focus sequence when everything works nicely:

Focus window is 000214C2 ("WhatFocus"); Active window is 000214C2 ("WhatFocus")
Focus window is 00010812 ("(Bridge View)"); Active window is 000900B6 ("Lightroom Catalog-2 - Adobe Photoshop Lightroom Classic - Library")
Focus window is 00021430 ("Import new photos (counting...)"); Active window is 000314AE ("Synchronize Folder “2020”")
Focus window is 00010812 ("(Bridge View)"); Active window is 000900B6 ("Lightroom Catalog-2 - Adobe Photoshop Lightroom Classic - Library")


Photo of Erich Schlaikjer

Erich Schlaikjer

  • 41 Posts
  • 7 Reply Likes
The "Create collection" dialog dismisses correctly with "escape" every time for me. It is not trying to do anything asynchronously.
Photo of John R. Ellis

John R. Ellis, Champion

  • 5129 Posts
  • 1453 Reply Likes
Here's a recipe that reliably reproduces the bug on my LR 9.2 / Windows 10 installation:

1. In the Library Folders panel, with no photos selected, right-click an existing folder and do Create Folder Inside. Name the new folder "test".

2. Right-click the folder "test" and do Synchronize Folder.

3. Observe that Escape incorrectly does not close the Synchronize Folder dialog (bug).  Click cancel.

4. In Windows File Explorer, move a photo into "test".

5. In the LR Folders panel, right-click "test" and do Synchronize Folder.

6. Observe that Escape correctly closes the dialog.
Photo of John R. Ellis

John R. Ellis, Champion

  • 5129 Posts
  • 1453 Reply Likes
What I've inferred from ten years of plugin development: For the user interface, LR uses non-preemptive tasks that all run in a single operating system thread. One task will yield to another only when it terminates or does a blocking call, e.g. to do file I/O. I believe there's a single message loop.

LR uses multiple operating-system threads for things like export and building previews. 

LR uses only the lowest levels of the window system on both Mac and and Windows, building its own library of window management and controls to reduce the cost of portability.

(It would be great if Adobe developers could correct or enhance this information, but the last time a developer actively communicated with the plugin community publicly was LR 4, I believe.)