From 49a013cdd383ba5d5296376ed7eb1f37c755b86a Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 28 Jan 2003 00:34:07 +0000 Subject: [PATCH] When using desktop mode attach all thread inputs together, so that keyboard focus works properly. --- dlls/x11drv/desktop.c | 3 ++- dlls/x11drv/x11drv_main.c | 2 ++ include/x11drv.h | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/dlls/x11drv/desktop.c b/dlls/x11drv/desktop.c index 1e452f024b4..ce97fd595bd 100644 --- a/dlls/x11drv/desktop.c +++ b/dlls/x11drv/desktop.c @@ -91,7 +91,8 @@ static DWORD CALLBACK desktop_thread( LPVOID driver_data ) */ void X11DRV_create_desktop_thread(void) { - HANDLE handle = CreateThread( NULL, 0, desktop_thread, NtCurrentTeb()->driver_data, 0, NULL ); + HANDLE handle = CreateThread( NULL, 0, desktop_thread, NtCurrentTeb()->driver_data, + 0, &desktop_tid ); if (!handle) { MESSAGE( "Could not create desktop thread\n" ); diff --git a/dlls/x11drv/x11drv_main.c b/dlls/x11drv/x11drv_main.c index 00caec81746..faabdb59b1e 100644 --- a/dlls/x11drv/x11drv_main.c +++ b/dlls/x11drv/x11drv_main.c @@ -57,6 +57,7 @@ unsigned int screen_width; unsigned int screen_height; unsigned int screen_depth; Window root_window; +DWORD desktop_tid = 0; int dxgrab, usedga, usexvidmode; int use_take_focus = 1; int managed_mode = 1; @@ -439,6 +440,7 @@ struct x11drv_thread_data *x11drv_init_thread_data(void) data->cursor_window = None; data->last_focus = 0; NtCurrentTeb()->driver_data = data; + if (desktop_tid) AttachThreadInput( GetCurrentThreadId(), desktop_tid, TRUE ); return data; } diff --git a/include/x11drv.h b/include/x11drv.h index 621a877a307..58d54f4e09a 100644 --- a/include/x11drv.h +++ b/include/x11drv.h @@ -353,6 +353,7 @@ inline static Display *thread_display(void) { return x11drv_thread_data()->displ extern Visual *visual; extern Window root_window; +extern DWORD desktop_tid; extern unsigned int screen_width; extern unsigned int screen_height; extern unsigned int screen_depth;