mirror of
https://github.com/immense/Remotely.git
synced 2025-10-26 11:27:15 +00:00
Send input on STA thread.
This commit is contained in:
parent
27c78038c5
commit
c675e359fb
@ -344,11 +344,13 @@ namespace Remotely.Desktop.Win.Services
|
||||
{
|
||||
if (!_inputBlocked)
|
||||
{
|
||||
if (!Win32Interop.SwitchToInputDesktop())
|
||||
var inputThread = new Thread(() =>
|
||||
{
|
||||
Logger.Write("Desktop switch failed while sending input.");
|
||||
}
|
||||
inputAction();
|
||||
Win32Interop.SwitchToInputDesktop();
|
||||
inputAction();
|
||||
});
|
||||
inputThread.SetApartmentState(ApartmentState.STA);
|
||||
inputThread.Start();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user