diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java index 1f905fbc3..7993c1fda 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/domain/BookmarkBase.java @@ -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); } diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java index 2ade62ef1..cbdabb1a0 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/presentation/BookmarkActivity.java @@ -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) diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java index 9401a2bda..a4e510440 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkBaseGateway.java @@ -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( diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java index f92abb459..c168f7cb2 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/BookmarkDB.java @@ -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', " diff --git a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java index d54aa0475..2d9314e7b 100644 --- a/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java +++ b/client/Android/Studio/freeRDPCore/src/main/java/com/freerdp/freerdpcore/services/LibFreeRDP.java @@ -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()) diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-de/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-de/strings.xml index d309e57ee..4957b7fe7 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-de/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-de/strings.xml @@ -113,7 +113,6 @@ Remote Program Arbeitsverzeichnis Async channel - Async input Async update Konsolenmodus diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-es/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-es/strings.xml index 63ed1c053..13c3ea4a2 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-es/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-es/strings.xml @@ -114,7 +114,6 @@ Programa Remoto Directorio de trabajo Async channel - Async input Async update Modo Consola diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-fr/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-fr/strings.xml index 9eacc705a..db7540186 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-fr/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-fr/strings.xml @@ -113,7 +113,6 @@ "Lancement de programme" "Répertoire de travail" Async channel - Async input Async update "Mode console" diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-ja/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-ja/strings.xml index d4cd51f05..bef1cf0af 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-ja/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-ja/strings.xml @@ -115,7 +115,6 @@ 遠隔実行するプログラム 作業フォルダ Async channel - Async input Async update コンソールモード diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-ko/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-ko/strings.xml index 495100dcc..e24b49d36 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-ko/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-ko/strings.xml @@ -154,7 +154,6 @@ 리모트 프로그램 작업 디렉터리 비동기 채널 - 비동기 입력 비동기 갱신 콘솔 모드 diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-nb-rNO/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-nb-rNO/strings.xml index 7237c396d..87f7f612e 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-nb-rNO/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-nb-rNO/strings.xml @@ -154,7 +154,6 @@ Fjernprogram Arbeidsmappe Asynk-kanal - Asynk-inndata Asynk-oppdatering Konsollmodus diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-nl/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-nl/strings.xml index 8e338ae4c..c12256b04 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-nl/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-nl/strings.xml @@ -114,7 +114,6 @@ Extern programma Werkmap Async channel - Async input Async update Console modus diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-pt-rBR/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-pt-rBR/strings.xml index c8ed05b4b..6f5840d83 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-pt-rBR/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-pt-rBR/strings.xml @@ -154,7 +154,6 @@ Programa remoto Pasta de trabalho Canal Async - Async input Atualização Async Modo Console diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values-zh/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values-zh/strings.xml index 0f5cdd7f6..9eb16c802 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values-zh/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values-zh/strings.xml @@ -119,7 +119,6 @@ 远程程序 工作目录 异步通道 - 异步输入 异步更新 控制台模式 diff --git a/client/Android/Studio/freeRDPCore/src/main/res/values/strings.xml b/client/Android/Studio/freeRDPCore/src/main/res/values/strings.xml index 1b0838fff..4c1abd52b 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/values/strings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/values/strings.xml @@ -154,7 +154,6 @@ Remote Program Working Directory Async channel - Async input Async update Console Mode diff --git a/client/Android/Studio/freeRDPCore/src/main/res/xml/debug_settings.xml b/client/Android/Studio/freeRDPCore/src/main/res/xml/debug_settings.xml index eb0515ac2..96331a4d8 100644 --- a/client/Android/Studio/freeRDPCore/src/main/res/xml/debug_settings.xml +++ b/client/Android/Studio/freeRDPCore/src/main/res/xml/debug_settings.xml @@ -31,8 +31,5 @@ - diff --git a/client/Android/android_freerdp.c b/client/Android/android_freerdp.c index 286353155..95368f534 100644 --- a/client/Android/android_freerdp.c +++ b/client/Android/android_freerdp.c @@ -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; } diff --git a/client/Mac/MRDPView.m b/client/Mac/MRDPView.m index 925eedab5..fef7bd345 100644 --- a/client/Mac/MRDPView.m +++ b/client/Mac/MRDPView.m @@ -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; } diff --git a/client/Mac/mf_client.m b/client/Mac/mf_client.m index aa53d5c94..d4c0b82fc 100644 --- a/client/Mac/mf_client.m +++ b/client/Mac/mf_client.m @@ -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; } diff --git a/client/Wayland/wlfreerdp.c b/client/Wayland/wlfreerdp.c index d1d556937..1219da288 100644 --- a/client/Wayland/wlfreerdp.c +++ b/client/Wayland/wlfreerdp.c @@ -449,10 +449,6 @@ static BOOL handle_window_events(freerdp* instance) settings = instance->settings; - if (!settings->AsyncInput) - { - } - return TRUE; } diff --git a/client/Windows/wf_client.c b/client/Windows/wf_client.c index a662cd939..52ebe5cbe 100644 --- a/client/Windows/wf_client.c +++ b/client/Windows/wf_client.c @@ -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); diff --git a/client/X11/xf_client.c b/client/X11/xf_client.c index c7828b37a..0eb667ac7 100644 --- a/client/X11/xf_client.c +++ b/client/X11/xf_client.c @@ -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); diff --git a/client/common/cmdline.c b/client/common/cmdline.c index a76a0bfff..33fac4748 100644 --- a/client/common/cmdline.c +++ b/client/common/cmdline.c @@ -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; diff --git a/client/common/cmdline.h b/client/common/cmdline.h index 667e2215f..611183e26 100644 --- a/client/common/cmdline.h +++ b/client/common/cmdline.h @@ -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, "", NULL, NULL, -1, NULL, diff --git a/include/freerdp/settings.h b/include/freerdp/settings.h index 9d2b2d39f..936a8f32b 100644 --- a/include/freerdp/settings.h +++ b/include/freerdp/settings.h @@ -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 */ diff --git a/libfreerdp/common/settings_getters.c b/libfreerdp/common/settings_getters.c index 2690fdfb6..2fe652d67 100644 --- a/libfreerdp/common/settings_getters.c +++ b/libfreerdp/common/settings_getters.c @@ -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; diff --git a/libfreerdp/common/settings_str.c b/libfreerdp/common/settings_str.c index 2fefce6e6..a9a2973fa 100644 --- a/libfreerdp/common/settings_str.c +++ b/libfreerdp/common/settings_str.c @@ -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" }, diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 2b2c62934..781209781 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -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) diff --git a/libfreerdp/core/input.c b/libfreerdp/core/input.c index 0f20aa7d1..9fc45a84d 100644 --- a/libfreerdp/core/input.c +++ b/libfreerdp/core/input.c @@ -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); diff --git a/libfreerdp/core/input.h b/libfreerdp/core/input.h index 5dd7dded3..ba5ac0e03 100644 --- a/libfreerdp/core/input.h +++ b/libfreerdp/core/input.h @@ -35,7 +35,6 @@ typedef struct rdpInput common; /* Internal */ - BOOL asynchronous; rdpInputProxy* proxy; wMessageQueue* queue; } rdp_input_internal; diff --git a/libfreerdp/core/message.c b/libfreerdp/core/message.c index 0e59431c0..3dc17b91f 100644 --- a/libfreerdp/core/message.c +++ b/libfreerdp/core/message.c @@ -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); -} diff --git a/libfreerdp/core/message.h b/libfreerdp/core/message.h index 33a78d56a..cb77ebf78 100644 --- a/libfreerdp/core/message.h +++ b/libfreerdp/core/message.h @@ -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 */ diff --git a/libfreerdp/core/test/settings_property_lists.h b/libfreerdp/core/test/settings_property_lists.h index 8df001858..27eb6d8b3 100644 --- a/libfreerdp/core/test/settings_property_lists.h +++ b/libfreerdp/core/test/settings_property_lists.h @@ -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, diff --git a/server/shadow/Win/win_rdp.c b/server/shadow/Win/win_rdp.c index 33cc7a57d..a6f74f435 100644 --- a/server/shadow/Win/win_rdp.c +++ b/server/shadow/Win/win_rdp.c @@ -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;