Commit c3f2a140 authored by Jukka Heinonen's avatar Jukka Heinonen Committed by Alexandre Julliard

GrabPointer uses now SetWindowLong to change window procedure instead

of accessing directly WND structure.
parent f2e7ce7f
......@@ -78,8 +78,6 @@ static LRESULT WINAPI GrabWndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM
static void GrabPointer(BOOL grab)
{
WND* pWnd;
if(grab) {
Window window = X11DRV_get_whole_window(GetFocus());
if(window)
......@@ -89,27 +87,16 @@ static void GrabPointer(BOOL grab)
if(!X11DRV_DD_GrabMessage)
X11DRV_DD_GrabMessage = RegisterWindowMessageA("WINE_X11DRV_GRABPOINTER");
pWnd = WIN_FindWndPtr(X11DRV_DD_PrimaryWnd);
if(!pWnd)
return;
X11DRV_DD_GrabOldProcedure = pWnd->winproc;
pWnd->winproc = GrabWndProc;
WIN_ReleaseWndPtr(pWnd);
/* FIXME: Replace with SetWindowLongPtrA when available */
X11DRV_DD_GrabOldProcedure = (WNDPROC)SetWindowLongA(X11DRV_DD_PrimaryWnd,
GWL_WNDPROC, (LONG)GrabWndProc);
SendMessageA(X11DRV_DD_PrimaryWnd, X11DRV_DD_GrabMessage, grab ? 1 : 0, 0);
pWnd = WIN_FindWndPtr(X11DRV_DD_PrimaryWnd);
if(!pWnd)
return;
if(pWnd->winproc != GrabWndProc)
/* FIXME: Replace with SetWindowLongPtrA when available */
if(SetWindowLongA(X11DRV_DD_PrimaryWnd, GWL_WNDPROC,
(LONG)X11DRV_DD_GrabOldProcedure) != (LONG)GrabWndProc)
ERR("Window procedure has been changed!\n");
else
pWnd->winproc = X11DRV_DD_GrabOldProcedure;
WIN_ReleaseWndPtr(pWnd);
}
static DWORD PASCAL X11DRV_DDHAL_DestroyDriver(LPDDHAL_DESTROYDRIVERDATA data)
......
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