Remove async-input from clients

This commit is contained in:
Armin Novak 2022-03-08 13:24:37 +01:00 committed by akallabeth
parent d337ea9c16
commit 71aac852d6
34 changed files with 9 additions and 496 deletions

View File

@ -282,7 +282,6 @@ public class BookmarkBase implements Parcelable, Cloneable
editor.putBoolean("bookmark.console_mode", advancedSettings.getConsoleMode());
editor.putBoolean("bookmark.async_channel", debugSettings.getAsyncChannel());
editor.putBoolean("bookmark.async_input", debugSettings.getAsyncInput());
editor.putBoolean("bookmark.async_update", debugSettings.getAsyncUpdate());
editor.putString("bookmark.debug_level", debugSettings.getDebugLevel());
@ -355,7 +354,6 @@ public class BookmarkBase implements Parcelable, Cloneable
advancedSettings.setConsoleMode(sharedPrefs.getBoolean("bookmark.console_mode", false));
debugSettings.setAsyncChannel(sharedPrefs.getBoolean("bookmark.async_channel", true));
debugSettings.setAsyncInput(sharedPrefs.getBoolean("bookmark.async_input", true));
debugSettings.setAsyncUpdate(sharedPrefs.getBoolean("bookmark.async_update", true));
debugSettings.setDebugLevel(sharedPrefs.getString("bookmark.debug_level", "INFO"));
}
@ -756,7 +754,6 @@ public class BookmarkBase implements Parcelable, Cloneable
private String debug;
private boolean asyncChannel;
private boolean asyncTransport;
private boolean asyncInput;
private boolean asyncUpdate;
public DebugSettings()
@ -769,7 +766,6 @@ public class BookmarkBase implements Parcelable, Cloneable
{
asyncChannel = parcel.readInt() == 1;
asyncTransport = parcel.readInt() == 1;
asyncInput = parcel.readInt() == 1;
asyncUpdate = parcel.readInt() == 1;
debug = parcel.readString();
}
@ -779,7 +775,6 @@ public class BookmarkBase implements Parcelable, Cloneable
debug = "INFO";
asyncChannel = true;
asyncTransport = false;
asyncInput = true;
asyncUpdate = true;
}
@ -819,16 +814,6 @@ public class BookmarkBase implements Parcelable, Cloneable
asyncUpdate = enabled;
}
public boolean getAsyncInput()
{
return asyncInput;
}
public void setAsyncInput(boolean enabled)
{
asyncInput = enabled;
}
public boolean getAsyncChannel()
{
return asyncChannel;
@ -848,7 +833,6 @@ public class BookmarkBase implements Parcelable, Cloneable
{
out.writeInt(asyncChannel ? 1 : 0);
out.writeInt(asyncTransport ? 1 : 0);
out.writeInt(asyncInput ? 1 : 0);
out.writeInt(asyncUpdate ? 1 : 0);
out.writeString(debug);
}

View File

@ -546,7 +546,6 @@ public class BookmarkActivity extends PreferenceActivity implements OnSharedPref
debugSettingsChanged(sharedPreferences, "bookmark.debug_level");
debugSettingsChanged(sharedPreferences, "bookmark.async_channel");
debugSettingsChanged(sharedPreferences, "bookmark.async_update");
debugSettingsChanged(sharedPreferences, "bookmark.async_input");
}
private void initGatewaySettings(SharedPreferences sharedPreferences)
@ -578,12 +577,6 @@ public class BookmarkActivity extends PreferenceActivity implements OnSharedPref
Preference pref = findPreference("bookmark.async_update");
pref.setDefaultValue(enabled);
}
else if (key.equals("bookmark.async_input"))
{
boolean enabled = sharedPreferences.getBoolean(key, false);
Preference pref = findPreference("bookmark.async_input");
pref.setDefaultValue(enabled);
}
}
private void gatewaySettingsChanged(SharedPreferences sharedPreferences, String key)

View File

@ -117,8 +117,6 @@ public abstract class BookmarkBaseGateway
values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL,
bookmark.getDebugSettings().getAsyncChannel());
values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT,
bookmark.getDebugSettings().getAsyncInput());
values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE,
bookmark.getDebugSettings().getAsyncUpdate());
values.put(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL,
@ -172,8 +170,6 @@ public abstract class BookmarkBaseGateway
values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL,
bookmark.getDebugSettings().getAsyncChannel());
values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT,
bookmark.getDebugSettings().getAsyncInput());
values.put(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE,
bookmark.getDebugSettings().getAsyncUpdate());
values.put(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL,
@ -327,7 +323,6 @@ public abstract class BookmarkBaseGateway
columns.add(BookmarkDB.DB_KEY_BOOKMARK_DEBUG_LEVEL);
columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL);
columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE);
columns.add(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT);
addBookmarkSpecificColumns(columns);
}
@ -442,8 +437,6 @@ public abstract class BookmarkBaseGateway
bookmark.getDebugSettings().setAsyncChannel(
cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_CHANNEL)) == 1);
bookmark.getDebugSettings().setAsyncInput(
cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_INPUT)) == 1);
bookmark.getDebugSettings().setAsyncUpdate(
cursor.getInt(cursor.getColumnIndex(BookmarkDB.DB_KEY_BOOKMARK_ASYNC_UPDATE)) == 1);
bookmark.getDebugSettings().setDebugLevel(

View File

@ -25,7 +25,7 @@ import java.util.List;
public class BookmarkDB extends SQLiteOpenHelper
{
public static final String ID = BaseColumns._ID;
private static final int DB_VERSION = 9;
private static final int DB_VERSION = 10;
private static final String DB_BACKUP_PREFIX = "temp_";
private static final String DB_NAME = "bookmarks.db";
static final String DB_TABLE_BOOKMARK = "tbl_manual_bookmarks";
@ -68,7 +68,6 @@ public class BookmarkDB extends SQLiteOpenHelper
static final String DB_KEY_BOOKMARK_REMOTE_PROGRAM = "remote_program";
static final String DB_KEY_BOOKMARK_WORK_DIR = "work_dir";
static final String DB_KEY_BOOKMARK_ASYNC_CHANNEL = "async_channel";
static final String DB_KEY_BOOKMARK_ASYNC_INPUT = "async_input";
static final String DB_KEY_BOOKMARK_ASYNC_UPDATE = "async_update";
static final String DB_KEY_BOOKMARK_CONSOLE_MODE = "console_mode";
static final String DB_KEY_BOOKMARK_DEBUG_LEVEL = "debug_level";
@ -282,7 +281,6 @@ public class BookmarkDB extends SQLiteOpenHelper
bookmarkValues.put(DB_KEY_BOOKMARK_REMOTE_PROGRAM, "");
bookmarkValues.put(DB_KEY_BOOKMARK_WORK_DIR, "");
bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_CHANNEL, 1);
bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_INPUT, 1);
bookmarkValues.put(DB_KEY_BOOKMARK_ASYNC_UPDATE, 1);
bookmarkValues.put(DB_KEY_BOOKMARK_CONSOLE_MODE, 0);
bookmarkValues.put(DB_KEY_BOOKMARK_DEBUG_LEVEL, "INFO");
@ -317,8 +315,7 @@ public class BookmarkDB extends SQLiteOpenHelper
DB_KEY_BOOKMARK_REDIRECT_MICROPHONE + " INTEGER DEFAULT 0, " +
DB_KEY_BOOKMARK_SECURITY + " INTEGER, " + DB_KEY_BOOKMARK_REMOTE_PROGRAM +
" TEXT, " + DB_KEY_BOOKMARK_WORK_DIR + " TEXT, " + DB_KEY_BOOKMARK_ASYNC_CHANNEL +
" INTEGER DEFAULT 0, " + DB_KEY_BOOKMARK_ASYNC_INPUT + " INTEGER DEFAULT 0, " +
DB_KEY_BOOKMARK_ASYNC_UPDATE + " INTEGER DEFAULT 0, " +
" INTEGER DEFAULT 0, " + DB_KEY_BOOKMARK_ASYNC_UPDATE + " INTEGER DEFAULT 0, " +
DB_KEY_BOOKMARK_CONSOLE_MODE + " INTEGER, " + DB_KEY_BOOKMARK_DEBUG_LEVEL +
" TEXT DEFAULT 'INFO', "

View File

@ -333,7 +333,6 @@ public class LibFreeRDP
}
args.add(addFlag("async-channels", debug.getAsyncChannel()));
args.add(addFlag("async-input", debug.getAsyncInput()));
args.add(addFlag("async-update", debug.getAsyncUpdate()));
if (advanced.getRedirectSDCard())

View File

@ -113,7 +113,6 @@
<string name="settings_remote_program">Remote Program</string>
<string name="settings_work_dir">Arbeitsverzeichnis</string>
<string name="settings_async_channel">Async channel</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Async update</string>
<string name="settings_console_mode">Konsolenmodus</string>
<!-- App settings strings -->

View File

@ -114,7 +114,6 @@
<string name="settings_remote_program">Programa Remoto</string>
<string name="settings_work_dir">Directorio de trabajo</string>
<string name="settings_async_channel">Async channel</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Async update</string>
<string name="settings_console_mode">Modo Consola</string>
<!-- App settings strings -->

View File

@ -113,7 +113,6 @@
<string name="settings_remote_program">"Lancement de programme"</string>
<string name="settings_work_dir">"Répertoire de travail"</string>
<string name="settings_async_channel">Async channel</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Async update</string>
<string name="settings_console_mode">"Mode console"</string>
<!-- App settings strings -->

View File

@ -115,7 +115,6 @@
<string name="settings_remote_program">遠隔実行するプログラム</string>
<string name="settings_work_dir">作業フォルダ</string>
<string name="settings_async_channel">Async channel</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Async update</string>
<string name="settings_console_mode">コンソールモード</string>
<!-- App settings strings -->

View File

@ -154,7 +154,6 @@
<string name="settings_remote_program">리모트 프로그램</string>
<string name="settings_work_dir">작업 디렉터리</string>
<string name="settings_async_channel">비동기 채널</string>
<string name="settings_async_input">비동기 입력</string>
<string name="settings_async_update">비동기 갱신</string>
<string name="settings_console_mode">콘솔 모드</string>
<!-- App settings strings -->

View File

@ -154,7 +154,6 @@
<string name="settings_remote_program">Fjernprogram</string>
<string name="settings_work_dir">Arbeidsmappe</string>
<string name="settings_async_channel">Asynk-kanal</string>
<string name="settings_async_input">Asynk-inndata</string>
<string name="settings_async_update">Asynk-oppdatering</string>
<string name="settings_console_mode">Konsollmodus</string>
<!-- App settings strings -->

View File

@ -114,7 +114,6 @@
<string name="settings_remote_program">Extern programma</string>
<string name="settings_work_dir">Werkmap</string>
<string name="settings_async_channel">Async channel</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Async update</string>
<string name="settings_console_mode">Console modus</string>
<!-- App settings strings -->

View File

@ -154,7 +154,6 @@
<string name="settings_remote_program">Programa remoto</string>
<string name="settings_work_dir">Pasta de trabalho</string>
<string name="settings_async_channel">Canal Async</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Atualização Async</string>
<string name="settings_console_mode">Modo Console</string>
<!-- App settings strings -->

View File

@ -119,7 +119,6 @@
<string name="settings_remote_program">远程程序</string>
<string name="settings_work_dir">工作目录</string>
<string name="settings_async_channel">异步通道</string>
<string name="settings_async_input">异步输入</string>
<string name="settings_async_update">异步更新</string>
<string name="settings_console_mode">控制台模式</string>
<!-- App settings strings -->

View File

@ -154,7 +154,6 @@
<string name="settings_remote_program">Remote Program</string>
<string name="settings_work_dir">Working Directory</string>
<string name="settings_async_channel">Async channel</string>
<string name="settings_async_input">Async input</string>
<string name="settings_async_update">Async update</string>
<string name="settings_console_mode">Console Mode</string>
<!-- App settings strings -->

View File

@ -31,8 +31,5 @@
<CheckBoxPreference
android:key="bookmark.async_update"
android:title="@string/settings_async_update" />
<CheckBoxPreference
android:key="bookmark.async_input"
android:title="@string/settings_async_input" />
</PreferenceCategory>
</PreferenceScreen>

View File

@ -419,80 +419,22 @@ static DWORD android_verify_changed_certificate_ex(freerdp* instance, const char
return res;
}
static DWORD WINAPI jni_input_thread(LPVOID arg)
{
HANDLE event[2];
wMessageQueue* queue;
freerdp* instance = (freerdp*)arg;
WLog_DBG(TAG, "input_thread Start.");
if (!(queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE)))
goto disconnect;
if (!(event[0] = android_get_handle(instance)))
goto disconnect;
if (!(event[1] = freerdp_get_message_queue_event_handle(instance, FREERDP_INPUT_MESSAGE_QUEUE)))
goto disconnect;
do
{
DWORD rc = WaitForMultipleObjects(2, event, FALSE, INFINITE);
if ((rc < WAIT_OBJECT_0) || (rc > WAIT_OBJECT_0 + 1))
continue;
if (rc == WAIT_OBJECT_0 + 1)
{
wMessage msg;
MessageQueue_Peek(queue, &msg, FALSE);
if (msg.id == WMQ_QUIT)
break;
}
if (android_check_handle(instance) != TRUE)
break;
} while (1);
WLog_DBG(TAG, "input_thread Quit.");
disconnect:
MessageQueue_PostQuit(queue, 0);
ExitThread(0);
return 0;
}
static int android_freerdp_run(freerdp* instance)
{
DWORD count;
DWORD status = WAIT_FAILED;
HANDLE handles[64];
HANDLE handles[MAXIMUM_WAIT_OBJECTS];
HANDLE inputEvent = NULL;
HANDLE inputThread = NULL;
const rdpSettings* settings = instance->context->settings;
rdpContext* context = instance->context;
BOOL async_input = settings->AsyncInput;
WLog_DBG(TAG, "AsyncInput=%" PRIu8 "", settings->AsyncInput);
if (async_input)
{
if (!(inputThread = CreateThread(NULL, 0, jni_input_thread, instance, 0, NULL)))
{
WLog_ERR(TAG, "async input: failed to create input thread");
goto disconnect;
}
}
else
inputEvent = android_get_handle(instance);
inputEvent = android_get_handle(instance);
while (!freerdp_shall_disconnect(instance))
{
DWORD tmp;
count = 0;
if (inputThread)
handles[count++] = inputThread;
else
handles[count++] = inputEvent;
tmp = freerdp_get_event_handles(context, &handles[count], 64 - count);
@ -527,29 +469,17 @@ static int android_freerdp_run(freerdp* instance)
if (freerdp_shall_disconnect(instance))
break;
if (!async_input)
{
if (android_check_handle(instance) != TRUE)
{
WLog_ERR(TAG, "Failed to check android file descriptor");
status = GetLastError();
break;
}
}
}
disconnect:
WLog_INFO(TAG, "Prepare shutdown...");
if (async_input && inputThread)
{
wMessageQueue* input_queue =
freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
MessageQueue_PostQuit(input_queue, 0);
WaitForSingleObject(inputThread, INFINITE);
CloseHandle(inputThread);
}
return status;
}

View File

@ -108,34 +108,6 @@ static DWORD WINAPI mac_client_thread(void *param);
return 0;
}
static DWORD WINAPI mac_client_input_thread(LPVOID param)
{
int status;
wMessage message;
wMessageQueue *queue;
rdpContext *context = (rdpContext *)param;
status = 1;
queue = freerdp_get_message_queue(context->instance, FREERDP_INPUT_MESSAGE_QUEUE);
while (MessageQueue_Wait(queue))
{
while (MessageQueue_Peek(queue, &message, TRUE))
{
status = freerdp_message_queue_process_message(context->instance,
FREERDP_INPUT_MESSAGE_QUEUE, &message);
if (!status)
break;
}
if (!status)
break;
}
ExitThread(0);
return 0;
}
DWORD WINAPI mac_client_thread(void *param)
{
@autoreleasepool
@ -144,7 +116,6 @@ DWORD WINAPI mac_client_thread(void *param)
DWORD rc;
HANDLE events[16] = { 0 };
HANDLE inputEvent;
HANDLE inputThread = NULL;
DWORD nCount;
DWORD nCountTmp;
DWORD nCountBase;
@ -165,16 +136,6 @@ DWORD WINAPI mac_client_thread(void *param)
nCount = 0;
events[nCount++] = mfc->stopEvent;
if (settings->AsyncInput)
{
if (!(inputThread = CreateThread(NULL, 0, mac_client_input_thread, context, 0, NULL)))
{
WLog_ERR(TAG, "failed to create async input thread");
goto disconnect;
}
}
else
{
if (!(inputEvent = freerdp_get_message_queue_event_handle(instance,
FREERDP_INPUT_MESSAGE_QUEUE)))
{
@ -183,7 +144,6 @@ DWORD WINAPI mac_client_thread(void *param)
}
events[nCount++] = inputEvent;
}
nCountBase = nCount;
@ -213,13 +173,10 @@ DWORD WINAPI mac_client_thread(void *param)
break;
}
if (!settings->AsyncInput)
{
if (WaitForSingleObject(inputEvent, 0) == WAIT_OBJECT_0)
{
input_activity_cb(instance);
}
}
{
if (!freerdp_check_event_handles(context))
@ -234,20 +191,6 @@ DWORD WINAPI mac_client_thread(void *param)
[view setIs_connected:0];
freerdp_disconnect(instance);
if (settings->AsyncInput && inputThread)
{
wMessageQueue *inputQueue =
freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
if (inputQueue)
{
MessageQueue_PostQuit(inputQueue, 0);
WaitForSingleObject(inputThread, INFINITE);
}
CloseHandle(inputThread);
}
ExitThread(0);
return 0;
}

View File

@ -99,7 +99,6 @@ static BOOL mfreerdp_client_new(freerdp *instance, rdpContext *context)
context->instance->LogonErrorInfo = mac_logon_error_info;
context->instance->settings = instance->settings;
settings = context->settings;
settings->AsyncInput = TRUE;
return TRUE;
}

View File

@ -449,10 +449,6 @@ static BOOL handle_window_events(freerdp* instance)
settings = instance->settings;
if (!settings->AsyncInput)
{
}
return TRUE;
}

View File

@ -955,35 +955,6 @@ static BOOL wf_present_gateway_message(freerdp* instance, UINT32 type, BOOL isDi
return TRUE;
}
static DWORD WINAPI wf_input_thread(LPVOID arg)
{
int status;
wMessage message;
wMessageQueue* queue;
freerdp* instance = (freerdp*)arg;
WINPR_ASSERT(NULL != instance);
status = 1;
queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
while (MessageQueue_Wait(queue))
{
while (MessageQueue_Peek(queue, &message, TRUE))
{
status = freerdp_message_queue_process_message(instance, FREERDP_INPUT_MESSAGE_QUEUE,
&message);
if (!status)
break;
}
if (!status)
break;
}
ExitThread(0);
return 0;
}
static DWORD WINAPI wf_client_thread(LPVOID lpParam)
{
MSG msg;
@ -993,14 +964,12 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam)
int quit_msg;
DWORD nCount;
DWORD error;
HANDLE handles[64];
HANDLE handles[MAXIMUM_WAIT_OBJECTS];
wfContext* wfc;
freerdp* instance;
rdpContext* context;
rdpChannels* channels;
rdpSettings* settings;
BOOL async_input;
HANDLE input_thread;
instance = (freerdp*)lpParam;
context = instance->context;
wfc = (wfContext*)instance->context;
@ -1010,16 +979,6 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam)
channels = instance->context->channels;
settings = instance->context->settings;
async_input = settings->AsyncInput;
if (async_input)
{
if (!(input_thread = CreateThread(NULL, 0, wf_input_thread, instance, 0, NULL)))
{
WLog_ERR(TAG, "Failed to create async input thread.");
goto disconnect;
}
}
while (1)
{
@ -1104,21 +1063,10 @@ static DWORD WINAPI wf_client_thread(LPVOID lpParam)
}
/* cleanup */
if (async_input)
{
wMessageQueue* input_queue;
input_queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
if (MessageQueue_PostQuit(input_queue, 0))
WaitForSingleObject(input_thread, INFINITE);
}
disconnect:
freerdp_disconnect(instance);
if (async_input)
CloseHandle(input_thread);
end:
error = freerdp_get_last_error(instance->context);
WLog_DBG(TAG, "Main thread exited with %" PRIu32, error);

View File

@ -1422,76 +1422,6 @@ static int xf_logon_error_info(freerdp* instance, UINT32 data, UINT32 type)
return 1;
}
static DWORD WINAPI xf_input_thread(LPVOID arg)
{
BOOL running = TRUE;
DWORD status;
DWORD nCount;
HANDLE events[3];
wMessage msg;
wMessageQueue* queue;
rdpSettings* settings;
freerdp* instance = (freerdp*)arg;
xfContext* xfc;
WINPR_ASSERT(instance);
xfc = (xfContext*)instance->context;
WINPR_ASSERT(xfc);
settings = xfc->common.context.settings;
WINPR_ASSERT(settings);
queue = freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
nCount = 0;
events[nCount++] = MessageQueue_Event(queue);
events[nCount++] = xfc->x11event;
events[nCount++] = instance->context->abortEvent;
while (running)
{
status = WaitForMultipleObjects(nCount, events, FALSE, INFINITE);
switch (status)
{
case WAIT_OBJECT_0:
case WAIT_OBJECT_0 + 1:
case WAIT_OBJECT_0 + 2:
if (WaitForSingleObject(events[0], 0) == WAIT_OBJECT_0)
{
if (MessageQueue_Peek(queue, &msg, FALSE))
{
if (msg.id == WMQ_QUIT)
running = FALSE;
}
}
if (WaitForSingleObject(events[1], 0) == WAIT_OBJECT_0)
{
if (!xf_process_x_events(instance))
{
running = FALSE;
break;
}
}
if (WaitForSingleObject(events[2], 0) == WAIT_OBJECT_0)
running = FALSE;
break;
default:
running = FALSE;
break;
}
}
MessageQueue_PostQuit(queue, 0);
freerdp_abort_connect(instance);
ExitThread(0);
return 0;
}
static BOOL handle_window_events(freerdp* instance)
{
rdpSettings* settings;
@ -1501,14 +1431,11 @@ static BOOL handle_window_events(freerdp* instance)
settings = instance->settings;
if (!settings->AsyncInput)
{
if (!xf_process_x_events(instance))
{
WLog_DBG(TAG, "Closed from X11");
return FALSE;
}
}
return TRUE;
}
@ -1531,11 +1458,11 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
freerdp* instance;
rdpContext* context;
HANDLE inputEvent = NULL;
HANDLE inputThread = NULL;
HANDLE timer = NULL;
LARGE_INTEGER due;
rdpSettings* settings;
TimerEventArgs timerEvent;
EventArgsInit(&timerEvent, "xfreerdp");
instance = (freerdp*)param;
context = instance->context;
@ -1671,28 +1598,13 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
{
goto disconnect;
}
if (!settings->AsyncInput)
{
inputEvent = xfc->x11event;
}
else
{
if (!(inputThread = CreateThread(NULL, 0, xf_input_thread, instance, 0, NULL)))
{
WLog_ERR(TAG, "async input: failed to create input thread");
exit_code = XF_EXIT_UNKNOWN;
goto disconnect;
}
}
inputEvent = xfc->x11event;
while (!freerdp_shall_disconnect(instance))
{
nCount = 0;
handles[nCount++] = timer;
if (!settings->AsyncInput)
handles[nCount++] = inputEvent;
handles[nCount++] = inputEvent;
/*
* win8 and server 2k12 seem to have some timing issue/race condition
@ -1758,12 +1670,6 @@ static DWORD WINAPI xf_client_thread(LPVOID param)
}
}
if (settings->AsyncInput)
{
WaitForSingleObject(inputThread, INFINITE);
CloseHandle(inputThread);
}
if (!exit_code)
{
exit_code = freerdp_error_info(instance);

View File

@ -3186,10 +3186,6 @@ int freerdp_client_settings_parse_command_line_arguments(rdpSettings* settings,
enable))
return COMMAND_LINE_ERROR;
}
CommandLineSwitchCase(arg, "async-input")
{
settings->AsyncInput = enable;
}
CommandLineSwitchCase(arg, "async-update")
{
settings->AsyncUpdate = enable;

View File

@ -52,8 +52,6 @@ static const COMMAND_LINE_ARGUMENT_A global_cmd_args[] = {
"Automatically request remote assistance input control" },
{ "async-channels", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL,
"Asynchronous channels (experimental)" },
{ "async-input", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL,
"Asynchronous input" },
{ "async-update", COMMAND_LINE_VALUE_BOOL, NULL, BoolValueFalse, NULL, -1, NULL,
"Asynchronous update" },
{ "audio-mode", COMMAND_LINE_VALUE_REQUIRED, "<mode>", NULL, NULL, -1, NULL,

View File

@ -701,7 +701,6 @@ typedef struct
#define FreeRDP_MouseMotion (1541)
#define FreeRDP_WindowTitle (1542)
#define FreeRDP_ParentWindowId (1543)
#define FreeRDP_AsyncInput (1544)
#define FreeRDP_AsyncUpdate (1545)
#define FreeRDP_AsyncChannels (1546)
#define FreeRDP_ToggleFullscreen (1548)
@ -1214,7 +1213,7 @@ struct rdp_settings
ALIGN64 BOOL MouseMotion; /* 1541 */
ALIGN64 char* WindowTitle; /* 1542 */
ALIGN64 UINT64 ParentWindowId; /* 1543 */
ALIGN64 BOOL AsyncInput; /* 1544 */
UINT64 padding1544[1545 - 1544]; /* 1544 */
ALIGN64 BOOL AsyncUpdate; /* 1545 */
ALIGN64 BOOL AsyncChannels; /* 1546 */
UINT64 padding1548[1548 - 1547]; /* 1547 */

View File

@ -51,9 +51,6 @@ BOOL freerdp_settings_get_bool(const rdpSettings* settings, size_t id)
case FreeRDP_AsyncChannels:
return settings->AsyncChannels;
case FreeRDP_AsyncInput:
return settings->AsyncInput;
case FreeRDP_AsyncUpdate:
return settings->AsyncUpdate;
@ -600,10 +597,6 @@ BOOL freerdp_settings_set_bool(rdpSettings* settings, size_t id, BOOL val)
settings->AsyncChannels = cnv.c;
break;
case FreeRDP_AsyncInput:
settings->AsyncInput = cnv.c;
break;
case FreeRDP_AsyncUpdate:
settings->AsyncUpdate = cnv.c;
break;

View File

@ -20,7 +20,6 @@ static const struct settings_str_entry settings_map[] = {
{ FreeRDP_AllowUnanouncedOrdersFromServer, 0, "FreeRDP_AllowUnanouncedOrdersFromServer" },
{ FreeRDP_AltSecFrameMarkerSupport, 0, "FreeRDP_AltSecFrameMarkerSupport" },
{ FreeRDP_AsyncChannels, 0, "FreeRDP_AsyncChannels" },
{ FreeRDP_AsyncInput, 0, "FreeRDP_AsyncInput" },
{ FreeRDP_AsyncUpdate, 0, "FreeRDP_AsyncUpdate" },
{ FreeRDP_AudioCapture, 0, "FreeRDP_AudioCapture" },
{ FreeRDP_AudioPlayback, 0, "FreeRDP_AudioPlayback" },

View File

@ -314,16 +314,6 @@ DWORD freerdp_get_event_handles(rdpContext* context, HANDLE* events, DWORD count
else
return 0;
WINPR_ASSERT(context->settings);
if (context->settings->AsyncInput)
{
if (nCount >= count)
return 0;
events[nCount++] =
freerdp_get_message_queue_event_handle(context->instance, FREERDP_INPUT_MESSAGE_QUEUE);
}
return nCount;
}
@ -363,18 +353,6 @@ BOOL freerdp_check_event_handles(rdpContext* context)
return FALSE;
}
WINPR_ASSERT(context->settings);
if (context->settings->AsyncInput)
{
int rc = freerdp_message_queue_process_pending_messages(context->instance,
FREERDP_INPUT_MESSAGE_QUEUE);
if (rc < 0)
return FALSE;
else
status = TRUE;
}
return status;
}
@ -493,13 +471,6 @@ BOOL freerdp_disconnect(freerdp* instance)
update_post_disconnect(instance->update);
if (instance->settings->AsyncInput)
{
wMessageQueue* inputQueue =
freerdp_get_message_queue(instance, FREERDP_INPUT_MESSAGE_QUEUE);
MessageQueue_PostQuit(inputQueue, 0);
}
IFCALL(instance->PostDisconnect, instance);
if (up->pcap_rfx)

View File

@ -656,16 +656,6 @@ BOOL input_register_client_callbacks(rdpInput* input)
input->FocusInEvent = input_send_focus_in_event;
}
in->asynchronous = settings->AsyncInput;
if (in->asynchronous)
{
in->proxy = input_message_proxy_new(input);
if (!in->proxy)
return FALSE;
}
return TRUE;
}
@ -795,8 +785,6 @@ void input_free(rdpInput* input)
if (input != NULL)
{
rdp_input_internal* in = input_cast(input);
if (in->asynchronous)
input_message_proxy_free(in->proxy);
MessageQueue_Free(in->queue);
free(in);

View File

@ -35,7 +35,6 @@ typedef struct
rdpInput common;
/* Internal */
BOOL asynchronous;
rdpInputProxy* proxy;
wMessageQueue* queue;
} rdp_input_internal;

View File

@ -2914,59 +2914,6 @@ void update_message_proxy_free(rdpUpdateProxy* message)
}
}
/* Input */
static BOOL input_message_SynchronizeEvent(rdpInput* input, UINT32 flags)
{
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, SynchronizeEvent),
(void*)(size_t)flags, NULL);
}
static BOOL input_message_KeyboardEvent(rdpInput* input, UINT16 flags, UINT16 code)
{
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, KeyboardEvent),
(void*)(size_t)flags, (void*)(size_t)code);
}
static BOOL input_message_UnicodeKeyboardEvent(rdpInput* input, UINT16 flags, UINT16 code)
{
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, UnicodeKeyboardEvent),
(void*)(size_t)flags, (void*)(size_t)code);
}
static BOOL input_message_MouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
UINT32 pos = (x << 16) | y;
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, MouseEvent),
(void*)(size_t)flags, (void*)(size_t)pos);
}
static BOOL input_message_ExtendedMouseEvent(rdpInput* input, UINT16 flags, UINT16 x, UINT16 y)
{
UINT32 pos = (x << 16) | y;
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, ExtendedMouseEvent),
(void*)(size_t)flags, (void*)(size_t)pos);
}
static BOOL input_message_FocusInEvent(rdpInput* input, UINT16 toggleStates)
{
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, FocusInEvent),
(void*)(size_t)toggleStates, NULL);
}
static BOOL input_message_KeyboardPauseEvent(rdpInput* input)
{
rdp_input_internal* in = input_cast(input);
return MessageQueue_Post(in->queue, (void*)input, MakeMessageId(Input, KeyboardPauseEvent),
NULL, NULL);
}
/* Event Queue */
static int input_message_free_input_class(wMessage* msg, int type)
{
@ -3182,50 +3129,3 @@ int input_message_queue_process_pending_messages(rdpInput* input)
return status;
}
static BOOL input_message_proxy_register(rdpInputProxy* proxy, rdpInput* input)
{
if (!proxy || !input)
return FALSE;
/* Input */
proxy->SynchronizeEvent = input->SynchronizeEvent;
proxy->KeyboardEvent = input->KeyboardEvent;
proxy->UnicodeKeyboardEvent = input->UnicodeKeyboardEvent;
proxy->MouseEvent = input->MouseEvent;
proxy->ExtendedMouseEvent = input->ExtendedMouseEvent;
proxy->FocusInEvent = input->FocusInEvent;
proxy->KeyboardPauseEvent = input->KeyboardPauseEvent;
input->SynchronizeEvent = input_message_SynchronizeEvent;
input->KeyboardEvent = input_message_KeyboardEvent;
input->UnicodeKeyboardEvent = input_message_UnicodeKeyboardEvent;
input->MouseEvent = input_message_MouseEvent;
input->ExtendedMouseEvent = input_message_ExtendedMouseEvent;
input->FocusInEvent = input_message_FocusInEvent;
input->KeyboardPauseEvent = input_message_KeyboardPauseEvent;
return TRUE;
}
rdpInputProxy* input_message_proxy_new(rdpInput* input)
{
rdpInputProxy* proxy;
proxy = (rdpInputProxy*)calloc(1, sizeof(rdpInputProxy));
if (!proxy)
return NULL;
proxy->input = input;
if (!input_message_proxy_register(proxy, input))
{
free(proxy);
return NULL;
}
return proxy;
}
void input_message_proxy_free(rdpInputProxy* proxy)
{
free(proxy);
}

View File

@ -161,7 +161,4 @@ FREERDP_LOCAL int input_message_queue_process_message(rdpInput* input, wMessage*
FREERDP_LOCAL int input_message_queue_free_message(wMessage* message);
FREERDP_LOCAL int input_message_queue_process_pending_messages(rdpInput* input);
FREERDP_LOCAL rdpInputProxy* input_message_proxy_new(rdpInput* input);
FREERDP_LOCAL void input_message_proxy_free(rdpInputProxy* proxy);
#endif /* FREERDP_LIB_CORE_MESSAGE_H */

View File

@ -9,7 +9,6 @@ static const size_t bool_list_indices[] = {
FreeRDP_AllowUnanouncedOrdersFromServer,
FreeRDP_AltSecFrameMarkerSupport,
FreeRDP_AsyncChannels,
FreeRDP_AsyncInput,
FreeRDP_AsyncUpdate,
FreeRDP_AudioCapture,
FreeRDP_AudioPlayback,

View File

@ -276,7 +276,6 @@ static BOOL shw_freerdp_client_new(freerdp* instance, rdpContext* context)
shw->settings = instance->context->settings;
settings->AsyncChannels = FALSE;
settings->AsyncUpdate = FALSE;
settings->AsyncInput = FALSE;
settings->IgnoreCertificate = TRUE;
settings->ExternalCertificateManagement = TRUE;
settings->RdpSecurity = TRUE;