-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot open new right-click menu before prompt is closed #93
Comments
I have looked at this issue and I have been easily able to reproduce it. I am not certain that launching the actions handler in a separate thread might be the best way to solve the problem. <exec path="${env.ComSpec}" basedir="${selection.path}" arguments="/C start "Searching for ${findpattern}" %ComSpec% /K dir /a /s /b "${findpattern}"" /> This solution would be appropriate for all leaf actions (the last action of a series) that have the potential to execute for a long period of time. However, with such a design, you loose the ability to know if the spawned process is successful or not (you only know if you spawn the process correctly or not.) Another option would be to define an attribute to the If we go the multithread way, we will have to implement many locks at multiple locations to make the application thread-safe. We will also need a ThreadManager to handle all thread workers, monitors to know when a Actions run is completed or has return an issue. This is not a no-go but the task may be easily underestimated. For example, Windows Explorer periodically ask the shell extension if it can be unloaded, most of the time, the answer is yes unless it is executing something. If we have running threads or a thread leak (lets say a thread is in a deadlock), then the system may crash. But my main concern about executing Actions of a menu in a separate thread is the Property System. More specifically the "selection-based properties". Right now, the property system is not "thread aware" which means that you cannot define a property that lives ONLY in the current thread. Without this functionality, if you execute the actions of two menus simultaneously, the selection-based properties of the second menu will overrides the selection-based properties of the first menu execution. This could easily lead to incorrect execution. I am open to new ideas but I must admit that none of the design or workaround mentioned above seems like the perfect option to solve this problem. Any ideas ? |
… wait on the actions to complete. For #93.
Reproducing configuration: <?xml version="1.0" encoding="utf-8"?>
<root>
<shell>
<menu separator="true" />
<menu name="issue83">
<actions>
<message caption="Issue #93" title="You clicked on file/directory '${selection.filename}'" />
</actions>
</menu>
<menu separator="true" />
</shell>
</root> |
Describe the bug
Currently ShellAnything is single-threaded, and some actions may block. Then explorer will always wait for ShellAnything. During this time, the new right-click menu cannot be opened.
To Reproduce
Take "Find a file..." written in "default.xml" as an example:
Expected behavior
ShellAnything should return immediately. The action should probably work in a new thread.
Screenshots
N/A
Environment
Additional context
N/A
The text was updated successfully, but these errors were encountered: