Commit 8ed49598 authored by Robert North's avatar Robert North Committed by Alexandre Julliard

- Don't post messages on Wine message queue, if tablet context flags

posting are disabled. - When posting messages on Wine message queue, use message base stored in tablet context, not the default message base. - Ensure that X11 Proximity events put messages onto Wintab message queue.
parent f8e559f7
......@@ -219,7 +219,7 @@ LPOPENCONTEXT AddPacketToContextQueue(LPWTPACKET packet, HWND hwnd)
{
ptr->ActiveCursor = packet->pkCursor;
if (ptr->context.lcOptions & CXO_CSRMESSAGES)
TABLET_PostTabletMessage(ptr, WT_CSRCHANGE,
TABLET_PostTabletMessage(ptr, _WT_CSRCHANGE(ptr->context.lcMsgBase),
(WPARAM)packet->pkSerialNumber, (LPARAM)ptr->handle,
FALSE);
}
......@@ -419,12 +419,12 @@ HCTX WINAPI WTOpenA(HWND hWnd, LPLOGCONTEXTA lpLogCtx, BOOL fEnable)
pAttachEventQueueToTablet(hWnd);
TABLET_PostTabletMessage(newcontext, WT_CTXOPEN, (WPARAM)newcontext->handle,
TABLET_PostTabletMessage(newcontext, _WT_CTXOPEN(newcontext->context.lcMsgBase), (WPARAM)newcontext->handle,
newcontext->context.lcStatus, TRUE);
newcontext->context.lcStatus = CXS_ONTOP;
TABLET_PostTabletMessage(newcontext, WT_CTXOVERLAP,
TABLET_PostTabletMessage(newcontext, _WT_CTXOVERLAP(newcontext->context.lcMsgBase),
(WPARAM)newcontext->handle,
newcontext->context.lcStatus, TRUE);
......@@ -474,7 +474,7 @@ BOOL WINAPI WTClose(HCTX hCtx)
LeaveCriticalSection(&csTablet);
TABLET_PostTabletMessage(context, WT_CTXCLOSE, (WPARAM)context->handle,
TABLET_PostTabletMessage(context, _WT_CTXCLOSE(context->context.lcMsgBase), (WPARAM)context->handle,
context->context.lcStatus,TRUE);
HeapFree(GetProcessHeap(),0,context->PacketQueue);
......
......@@ -123,17 +123,19 @@ static LRESULT WINAPI TABLET_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam,
LPOPENCONTEXT handler;
pGetCurrentPacket(&packet);
handler = AddPacketToContextQueue(&packet,(HWND)lParam);
if (handler)
TABLET_PostTabletMessage(handler, WT_PACKET,
if (handler && handler->context.lcOptions & CXO_MESSAGES)
TABLET_PostTabletMessage(handler, _WT_PACKET(handler->context.lcMsgBase),
(WPARAM)packet.pkSerialNumber,
(LPARAM)handler->handle, FALSE);
break;
}
case WT_PROXIMITY:
{
WTPACKET packet;
LPOPENCONTEXT handler;
LPARAM prox;
handler = FindOpenContext((HWND)lParam);
pGetCurrentPacket(&packet);
handler = AddPacketToContextQueue(&packet,(HWND)lParam);
if (handler)
{
prox = MAKELPARAM( wParam, 1 );
......
......@@ -647,9 +647,23 @@ int X11DRV_ProcessTabletEvent(HWND hwnd, XEvent *event)
else if ((event->type == proximity_in_type) ||
(event->type == proximity_out_type))
{
XProximityNotifyEvent *proximity = (XProximityNotifyEvent *) event;
TRACE_(event)("Received tablet proximity event\n");
TRACE("Received tablet proximity event\n");
gMsgPacket.pkStatus = (event->type==proximity_out_type)?TPS_PROXIMITY:0;
gMsgPacket.pkTime = proximity->time;
gMsgPacket.pkSerialNumber = gSerial++;
gMsgPacket.pkCursor = proximity->deviceid;
gMsgPacket.pkX = proximity->axis_data[0];
gMsgPacket.pkY = proximity->axis_data[1];
gMsgPacket.pkOrientation.orAzimuth =
figure_deg(proximity->axis_data[3],proximity->axis_data[4]);
gMsgPacket.pkOrientation.orAltitude = 1000 - 15 * max
(abs(proximity->axis_data[3]),abs(proximity->axis_data[4]));
gMsgPacket.pkNormalPressure = proximity->axis_data[2];
gMsgPacket.pkButtons = get_button_state(proximity->deviceid);
SendMessageW(hwndTabletDefault, WT_PROXIMITY,
(event->type==proximity_out_type)?0:1, (LPARAM)hwnd);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment