From 73b4005211e79a56a80fabf24b6514dd76a9a845 Mon Sep 17 00:00:00 2001 From: John Klehm Date: Mon, 28 Apr 2008 23:06:25 -0500 Subject: winex11.drv: Search more thoroughly for the parent window when attaching a tablet event --- dlls/winex11.drv/wintab.c | 22 ++++++++++++++++++---- 1 files changed, 18 insertions(+), 4 deletions(-) diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index 333e0b8..3ee032c 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -928,11 +928,25 @@ int X11DRV_AttachEventQueueToTablet(HWND hOwner) XDeviceInfo *target = NULL; XDevice *the_device; XEventClass event_list[7]; - Window win = X11DRV_get_whole_window( hOwner ); + Window win; + HWND hParent; - if (!win) return 0; + TRACE("hOwner=%p, gNumCursors=%i\n", hOwner, gNumCursors); - TRACE("Creating context for window %p (%lx) %i cursors\n", hOwner, win, gNumCursors); + hParent = GetAncestor(hOwner, GA_ROOT); + TRACE("Trying hParent=GetAncestor(hOwner, GA_ROOT)=%p\n", hParent); + if ( !(win = X11DRV_get_whole_window(hParent)) ) + { + hParent = GetDesktopWindow(); + TRACE("Trying hParent=GetDesktopWindow()=%p\n", hParent); + if ( !(win = X11DRV_get_whole_window(hParent)) ) + { + TRACE("Failed to attach to a window.\n"); + return 0; + } + } + + TRACE("Creating context for hParent=%p, X11 win=%lx\n", hParent, win); wine_tsx11_lock(); devices = pXListInputDevices(data->display, &num_devices); @@ -992,7 +1006,7 @@ int X11DRV_AttachEventQueueToTablet(HWND hOwner) if (NULL != devices) pXFreeDeviceList(devices); wine_tsx11_unlock(); - return 0; + return 1; } /*********************************************************************** -- 1.5.4.5