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