diff --git a/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp b/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp index d74b4b0558..5f218c3ee0 100644 --- a/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp +++ b/Source/Plugins/Plugin_VideoDX9/Src/EmuWindow.cpp @@ -20,7 +20,6 @@ HWND GetWnd() { return m_hWnd; } - HWND GetParentWnd() { return m_hParent; @@ -105,6 +104,14 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam ) g_VideoInitialize.pKeyPress(LOWORD(wParam), GetAsyncKeyState(VK_SHIFT) != 0, GetAsyncKeyState(VK_CONTROL) != 0); break; + /* Post thes mouse events to the main window, it's nessesary because in difference to the + keyboard inputs these events only appear here, not in the parent window or any other WndProc()*/ + case WM_LBUTTONDOWN: + case WM_LBUTTONUP: + case WM_LBUTTONDBLCLK: + PostMessage(GetParentWnd(), iMsg, wParam, lParam); + break; + case WM_CLOSE: Fifo_ExitLoopNonBlocking(); Shutdown(); @@ -139,7 +146,7 @@ LRESULT CALLBACK WndProc( HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam ) HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const TCHAR *title) { wndClass.cbSize = sizeof( wndClass ); - wndClass.style = CS_HREDRAW | CS_VREDRAW; + wndClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; wndClass.lpfnWndProc = WndProc; wndClass.cbClsExtra = 0; wndClass.cbWndExtra = 0; @@ -180,7 +187,6 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T rc.top = (1024 - h)/2; rc.bottom = rc.top + h; - m_hWnd = CreateWindow(m_szClassName, title, style, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp index 53f403b291..48942096b2 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.cpp @@ -146,8 +146,7 @@ namespace EmuWindow { HWND m_hWnd = NULL; // The new window that is created here -HWND m_hParent = NULL; // The main wxFrame -HWND m_hMain = NULL; // The main CPanel +HWND m_hParent = NULL; // The main CPanel or the main wxFrame HINSTANCE m_hInstance = NULL; WNDCLASSEX wndClass; @@ -176,10 +175,6 @@ HWND GetParentWnd() { return m_hParent; } -HWND GetChildParentWnd() -{ - return m_hMain; -} void FreeLookInput( UINT iMsg, WPARAM wParam ) { @@ -257,7 +252,7 @@ void OnKeyDown(WPARAM wParam) else if (!g_Config.RenderToMainframe) { // And stops the emulation when already in Windowed mode - PostMessage(m_hMain, WM_USER, OPENGL_WM_USER_STOP, 0); + PostMessage(m_hParent, WM_USER, OPENGL_WM_USER_STOP, 0); } break; case '3': // OSD keys @@ -279,7 +274,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) switch( iMsg ) { case WM_CREATE: - PostMessage(m_hMain, WM_USER, OPENGL_WM_USER_CREATE, (int)m_hParent); + PostMessage(m_hParent, WM_USER, OPENGL_WM_USER_CREATE, (int)m_hParent); break; case WM_PAINT: @@ -311,7 +306,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) case WM_LBUTTONDOWN: case WM_LBUTTONUP: case WM_LBUTTONDBLCLK: - PostMessage(GetChildParentWnd(), iMsg, wParam, lParam); + PostMessage(GetParentWnd(), iMsg, wParam, lParam); break; /* The reason we pick up the WM_MOUSEMOVE is to be able to change this option @@ -324,7 +319,7 @@ LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg, WPARAM wParam, LPARAM lParam) it's nessesary for both the chil dwindow and separate rendering window because moves over the rendering window do not reach the main program then. */ if (GetParentWnd() == NULL) // Separate rendering window - PostMessage(m_hMain, iMsg, wParam, -1); + PostMessage(m_hParent, iMsg, wParam, -1); else PostMessage(GetParentWnd(), iMsg, wParam, lParam); break; @@ -401,7 +396,7 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T // Create child window if (parent) { - m_hParent = m_hMain = parent; + m_hParent = parent; m_hWnd = CreateWindow(m_szClassName, title, WS_CHILD, @@ -427,9 +422,6 @@ HWND OpenWindow(HWND parent, HINSTANCE hInstance, int width, int height, const T rc.top = (1024 - h)/2; rc.bottom = rc.top + h; - // I save this to m_hMain instead of m_hParent because it casused problems otherwise - m_hMain = (HWND)g_VideoInitialize.pWindowHandle; - m_hWnd = CreateWindow(m_szClassName, title, style, rc.left, rc.top, rc.right-rc.left, rc.bottom-rc.top, diff --git a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.h b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.h index d04b38b1ce..cfce376a63 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.h +++ b/Source/Plugins/Plugin_VideoOGL/Src/OS/Win32.h @@ -28,7 +28,6 @@ namespace EmuWindow HWND GetWnd(); HWND GetParentWnd(); - HWND GetChildParentWnd(); HWND Create(HWND hParent, HINSTANCE hInstance, const TCHAR *title); void Show(); void Close(); diff --git a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp index d7233e2970..aeab6595eb 100644 --- a/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp +++ b/Source/Plugins/Plugin_VideoOGL/Src/Render.cpp @@ -978,7 +978,7 @@ void Renderer::Swap(u32 xfbAddr, FieldType field, u32 fbWidth, u32 fbHeight) { if (!s_bLastFrameDumped) { - s_bAVIDumping = AVIDump::Start(EmuWindow::GetChildParentWnd(), w, h); + s_bAVIDumping = AVIDump::Start(EmuWindow::GetParentWnd(), w, h); if (!s_bAVIDumping) OSD::AddMessage("AVIDump Start failed", 2000); else