winex11.drv: Move hardware tablet proximity into x11 layer.

This commit is contained in:
John Klehm 2008-05-07 15:58:49 -05:00 committed by Alexandre Julliard
parent df2120e586
commit cd550bf6b4
2 changed files with 16 additions and 8 deletions

View File

@ -879,12 +879,15 @@ static void proximity_event( HWND hwnd, XEvent *event )
XProximityNotifyEvent *proximity = (XProximityNotifyEvent *) event; XProximityNotifyEvent *proximity = (XProximityNotifyEvent *) event;
LPWTI_CURSORS_INFO cursor; LPWTI_CURSORS_INFO cursor;
int curnum = cursor_from_device(proximity->deviceid, &cursor); int curnum = cursor_from_device(proximity->deviceid, &cursor);
LPARAM proximity_info;
TRACE("hwnd=%p\n", hwnd);
if (curnum < 0) if (curnum < 0)
return; return;
memset(&gMsgPacket,0,sizeof(WTPACKET)); memset(&gMsgPacket,0,sizeof(WTPACKET));
TRACE("Received tablet proximity event\n");
/* Set cursor to inverted if cursor is the eraser */ /* Set cursor to inverted if cursor is the eraser */
gMsgPacket.pkStatus = (cursor->TYPE == CSR_TYPE_ERASER ? TPS_INVERT:0); gMsgPacket.pkStatus = (cursor->TYPE == CSR_TYPE_ERASER ? TPS_INVERT:0);
gMsgPacket.pkStatus |= (event->type==proximity_out_type)?TPS_PROXIMITY: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.pkNormalPressure = proximity->axis_data[2];
gMsgPacket.pkButtons = get_button_state(curnum); 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);
} }
/*********************************************************************** /***********************************************************************

View File

@ -136,15 +136,11 @@ static LRESULT WINAPI TABLET_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
{ {
WTPACKET packet; WTPACKET packet;
LPOPENCONTEXT handler; LPOPENCONTEXT handler;
LPARAM prox;
pGetCurrentPacket(&packet); pGetCurrentPacket(&packet);
handler = AddPacketToContextQueue(&packet,(HWND)lParam); handler = AddPacketToContextQueue(&packet,(HWND)wParam);
if (handler) if (handler)
{
prox = MAKELPARAM( wParam, 1 );
TABLET_PostTabletMessage(handler, WT_PROXIMITY, TABLET_PostTabletMessage(handler, WT_PROXIMITY,
(WPARAM)handler->handle, prox, TRUE); (WPARAM)handler->handle, lParam, TRUE);
}
break; break;
} }
} }