From aa8d797eb6a1323b98215329358e6d521418003f Mon Sep 17 00:00:00 2001 From: Eric Wasylishen Date: Mon, 15 Mar 2010 07:19:22 +0000 Subject: [PATCH] back/win32: fix for mouse/keyboard events on NSOpenGLView git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/back/trunk@29957 72102866-910b-0410-8b05-ffd578937521 --- ChangeLog | 8 ++++++++ Source/win32/w32_GLcontext.m | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8c9bc95..7f0885d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-03-13 Eric Wasylishen + + * Source/win32/w32_GLcontext.m: Set the WS_DISABLED flag + on the OpenGL subwindow so mouse/keyboard events get + redirected to the parent window. + Previously mouse/keyboard events were being eaten by + the OpenGL subwindow - now they work as expected. + 2010-03-13 Eric Wasylishen * Source/win32/w32_GLcontext.m: diff --git a/Source/win32/w32_GLcontext.m b/Source/win32/w32_GLcontext.m index 7822f81..650e5a4 100644 --- a/Source/win32/w32_GLcontext.m +++ b/Source/win32/w32_GLcontext.m @@ -153,9 +153,11 @@ LRESULT CALLBACK win32SubwindowProc( NSDebugMLLog(@"WGL", @"MS window creation (%d, %d, %u, %u)", x, y, width, height); + /* WS_DISABLED causes mouse/keyboard events to be forwarded to the parent window + so they can be processed normally; otherwise the OpenGL window would eat them */ winid = CreateWindow( NSOPENGLSUBWINDOWCLASS, NSOPENGLSUBWINDOWNAME, - WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE, + WS_CHILD | WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | WS_DISABLED, x, y, width, height, (HWND)[win windowNumber], (HMENU)NULL, hInstance, (LPVOID)self);