[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17605] branches/web-plugin/intern/ghost/ intern: GHOST_WindowWin32 :: set the focus to the game engine' s window when clicking.

Marcelo Coraça de Freitas mfreitas at ydeasolutions.com.br
Fri Nov 28 22:15:19 CET 2008


Revision: 17605
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17605
Author:   mfreitas
Date:     2008-11-28 22:15:19 +0100 (Fri, 28 Nov 2008)

Log Message:
-----------
GHOST_WindowWin32 :: set the focus to the game engine's window when clicking. This is so when running from the web plugin will be able to capture keyboard events.
GHOST_SystemWin32 :: let WM_DESTROY event close the engine. It's for when TerminateProcess, from the ActiveX control, doesn't run.

Modified Paths:
--------------
    branches/web-plugin/intern/ghost/intern/GHOST_SystemWin32.cpp
    branches/web-plugin/intern/ghost/intern/GHOST_WindowWin32.cpp

Modified: branches/web-plugin/intern/ghost/intern/GHOST_SystemWin32.cpp
===================================================================
--- branches/web-plugin/intern/ghost/intern/GHOST_SystemWin32.cpp	2008-11-28 21:12:27 UTC (rev 17604)
+++ branches/web-plugin/intern/ghost/intern/GHOST_SystemWin32.cpp	2008-11-28 21:15:19 UTC (rev 17605)
@@ -735,6 +735,15 @@
 				////////////////////////////////////////////////////////////////////////
 				// Window events, processed
 				////////////////////////////////////////////////////////////////////////
+				case WM_DESTROY:
+					/* The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window 
+					 * procedure of the window being destroyed after the window is removed from the screen.	
+					 * This message is sent first to the window being destroyed and then to the child windows 
+					 * (if any) as they are destroyed. During the processing of the message, it can be assumed 
+					 * that all child windows still exist. 
+					 *
+					 * This is required for the blender ActiveX plugin code.
+					 */
 				case WM_CLOSE:
 					/* The WM_CLOSE message is sent as a signal that a window or an application should terminate. */
 					event = processWindowEvent(GHOST_kEventWindowClose, window);
@@ -799,13 +808,6 @@
 					/* The WM_NCACTIVATE message is sent to a window when its nonclient area needs to be changed 
 					 * to indicate an active or inactive state. 
 					 */
-				case WM_DESTROY:
-					/* The WM_DESTROY message is sent when a window is being destroyed. It is sent to the window 
-					 * procedure of the window being destroyed after the window is removed from the screen.	
-					 * This message is sent first to the window being destroyed and then to the child windows 
-					 * (if any) as they are destroyed. During the processing of the message, it can be assumed 
-					 * that all child windows still exist. 
-					 */
 				case WM_NCDESTROY:
 					/* The WM_NCDESTROY message informs a window that its nonclient area is being destroyed. The 
 					 * DestroyWindow function sends the WM_NCDESTROY message to the window following the WM_DESTROY

Modified: branches/web-plugin/intern/ghost/intern/GHOST_WindowWin32.cpp
===================================================================
--- branches/web-plugin/intern/ghost/intern/GHOST_WindowWin32.cpp	2008-11-28 21:12:27 UTC (rev 17604)
+++ branches/web-plugin/intern/ghost/intern/GHOST_WindowWin32.cpp	2008-11-28 21:15:19 UTC (rev 17605)
@@ -583,6 +583,10 @@
 {
 	if (press) {
 		if (!m_hasMouseCaptured) {
+			/* We need to set focus to capture keyboard
+			 * and mouse wheel events in the activex web plugin
+			 */
+			::SetFocus(m_hWnd);
 			::SetCapture(m_hWnd);
 			m_hasMouseCaptured = true;
 		}





More information about the Bf-blender-cvs mailing list