Skip to content
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

Doesn't work if file dragged from the Total Commander ran as admin #48

Closed
mnaoumov opened this issue Jan 9, 2022 · 14 comments
Closed

Comments

@mnaoumov
Copy link

mnaoumov commented Jan 9, 2022

No description provided.

@HerMajestyDrMona
Copy link
Owner

Hmmm. The problem is that Windows displays a different error icon (perhaps cursor change) instead of the default one when a file is being dragged from a program that is run as administrator.

For now, if you often use Total Commander, you can disable error icon pixels detection in this program:
DetectKnownPixelColorsToPreventAccidentalEvents=0

@mnaoumov
Copy link
Author

mnaoumov commented Jan 9, 2022

@HerMajestyDrMona Thanks for the quick reply. Yes, your workaround worked!

@HerMajestyDrMona
Copy link
Owner

@mnaoumov Thanks for the info. I prepared a fix for this issue in ver. 2.2 (it will be released some day), however, Windows11DragAndDropToTaskbarPartialFix needs to be started as administrator in order to make it work. For some reasons it won't detect clicks done in the "run as administrator" apps. I believe it's some Windows security thing.

@mnaoumov
Copy link
Author

mnaoumov commented Jan 9, 2022

@HerMajestyDrMona I think this case is quite important so you should make it very explicit in the documentation. And maybe even consider to run your app as administrator by default, or at least make it configurable

@HerMajestyDrMona
Copy link
Owner

@mnaoumov No need to put it to the documentation because it will be fixed soon. The program for sure won't run as administrator by default (it always looks suspicious for ordinary users). Having an option to run as administrator is a good idea, but the same thing can be done by users in file properties -> compatibility tab, so I'm not sure if bloating this program even more is worth it.

@mnaoumov
Copy link
Author

@HerMajestyDrMona I assume your target audience of the app is not advanced users that might not even know how to use Compatibility tab

@HerMajestyDrMona
Copy link
Owner

Yes, but they might also have a problem understanding the "Configure..." option in this program. So either way it would need to be described in some "tutorial". The same ordinary users don't run the different file managers with administrative permissions.

I'm not sure how it would behave after computer restart if it was set to run as administrator. I would find it annoying to click "YES" in the UAC prompt every time computer restarts.

@mnaoumov
Copy link
Author

@HerMajestyDrMona I think if you run the app via Task Scheduler you can run it with elevated permissions without annoying UAC screen https://www.digitalcitizen.life/use-task-scheduler-launch-programs-without-uac-prompts/

@HerMajestyDrMona
Copy link
Owner

I just tested, and the default Autostart option simply won't work when the file compatibility is set to "always run as administrator".
So the program itself would need to check if is running as admin and then ask to restart itself.

Task Scheduler is a good thing, but not for "ordinary" users. The program itself shouldn't create Task Scheduler entries. We have already suffered from false positives in previous versions of the program, so adding such things wouldn't help.

What I think could be a good solution for now, is adding a new option to the tray icon: "Restart as administrator". This way the program would autostart with the default method, and whenever somebody experience problems could simply click on that button.

The problem could also be resolved in it's "roots". I now realized that the mouse click events are not detected inside of the program that is running as administrator. However, when it leaves the "administrator" window, it should be able to detect clicks normally. The problem is, that it won't because the mouse button was already pressed. So there could be an additional check for the current mouse button state. It might cause dozens of other problems (like the lack of the button up signal when the program returns to the administrator window), but still it's worth to give a try.

@mnaoumov
Copy link
Author

I don't see any automated testing in the source code. Wouldn't it be useful to write some tests to cover all those scenarios such as:

  1. Dragging from regular app to regular app
  2. Dragging from regular app to admin app
  3. Dragging from admin app to regular app
  4. Dragging from admin app to admin app

@HerMajestyDrMona
Copy link
Owner

How do you want to automate events that can only be done by users? If the program "simulated" the mouse events for tests it still would be inaccurate, because it would be done with the permissions that the actual instance of the program has, not the real user's scenario.

The other thing is, we're not developing some OpenSSL library, but a "simple" fix that is supposed not to be needed in a few months (Windows 11 22H2 release). So polishing it to the highest possible standards in my opinion is kind of waste of time.

@HerMajestyDrMona
Copy link
Owner

HerMajestyDrMona commented Jan 10, 2022

@mnaoumov I added some new options in ver. 2.2.0.0.
Please revert to:
DetectKnownPixelColorsToPreventAccidentalEvents=1
and let me know how it works :)

@mnaoumov
Copy link
Author

Works perfectly, thanks!

@HerMajestyDrMona
Copy link
Owner

Thanks for checking!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants