Module: wine Branch: master Commit: cd550bf6b4f52b6d5bcc4b62ca7f21a7831eb500 URL: http://source.winehq.org/git/wine.git/?a=commit;h=cd550bf6b4f52b6d5bcc4b62ca...
Author: John Klehm xixsimplicityxix@gmail.com Date: Wed May 7 15:58:49 2008 -0500
winex11.drv: Move hardware tablet proximity into x11 layer.
---
dlls/winex11.drv/wintab.c | 16 ++++++++++++++-- dlls/wintab32/wintab32.c | 8 ++------ 2 files changed, 16 insertions(+), 8 deletions(-)
diff --git a/dlls/winex11.drv/wintab.c b/dlls/winex11.drv/wintab.c index d4d7109..333e0b8 100644 --- a/dlls/winex11.drv/wintab.c +++ b/dlls/winex11.drv/wintab.c @@ -879,12 +879,15 @@ static void proximity_event( HWND hwnd, XEvent *event ) XProximityNotifyEvent *proximity = (XProximityNotifyEvent *) event; LPWTI_CURSORS_INFO cursor; int curnum = cursor_from_device(proximity->deviceid, &cursor); + LPARAM proximity_info; + + TRACE("hwnd=%p\n", hwnd); + if (curnum < 0) return;
memset(&gMsgPacket,0,sizeof(WTPACKET));
- TRACE("Received tablet proximity event\n"); /* Set cursor to inverted if cursor is the eraser */ gMsgPacket.pkStatus = (cursor->TYPE == CSR_TYPE_ERASER ? TPS_INVERT:0); gMsgPacket.pkStatus |= (event->type==proximity_out_type)?TPS_PROXIMITY:0; @@ -900,7 +903,16 @@ static void proximity_event( HWND hwnd, XEvent *event ) gMsgPacket.pkNormalPressure = proximity->axis_data[2]; gMsgPacket.pkButtons = get_button_state(curnum);
- SendMessageW(hwndTabletDefault, WT_PROXIMITY, (event->type == proximity_in_type), (LPARAM)hwnd); + /* FIXME: LPARAM loword is true when cursor entering context, false when leaving context + * This needs to be handled here or in wintab32. Using the proximity_in_type is not correct + * but kept for now. + * LPARAM hiword is "non-zero when the cursor is leaving or entering hardware proximity" + * WPARAM contains context handle. + * HWND to HCTX is handled by wintab32. + */ + proximity_info = MAKELPARAM((event->type == proximity_in_type), + (event->type == proximity_in_type) || (event->type == proximity_out_type)); + SendMessageW(hwndTabletDefault, WT_PROXIMITY, (WPARAM)hwnd, proximity_info); }
/*********************************************************************** diff --git a/dlls/wintab32/wintab32.c b/dlls/wintab32/wintab32.c index 1ef19d9..5f2afb1 100644 --- a/dlls/wintab32/wintab32.c +++ b/dlls/wintab32/wintab32.c @@ -136,15 +136,11 @@ static LRESULT WINAPI TABLET_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, { WTPACKET packet; LPOPENCONTEXT handler; - LPARAM prox; pGetCurrentPacket(&packet); - handler = AddPacketToContextQueue(&packet,(HWND)lParam); + handler = AddPacketToContextQueue(&packet,(HWND)wParam); if (handler) - { - prox = MAKELPARAM( wParam, 1 ); TABLET_PostTabletMessage(handler, WT_PROXIMITY, - (WPARAM)handler->handle, prox, TRUE); - } + (WPARAM)handler->handle, lParam, TRUE); break; } }