changeset 25940:8928a8401017

Forward mouse messages to -wid Window.
author reimar
date Sun, 10 Feb 2008 10:01:25 +0000
parents 5d7679358a53
children 42bb6260653a
files libvo/w32_common.c
diffstat 1 files changed, 15 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/w32_common.c	Sun Feb 10 06:53:35 2008 +0000
+++ b/libvo/w32_common.c	Sun Feb 10 10:01:25 2008 +0000
@@ -43,6 +43,7 @@
 static LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) {
     RECT r;
     POINT p;
+    if (WinID < 0 || message == WM_PAINT || message == WM_SIZE) {
     switch (message) {
         case WM_PAINT:
             event_flags |= VO_EVENT_EXPOSE;
@@ -143,6 +144,19 @@
                 break;
             }
     }
+    } else switch (message) {
+        case WM_MOUSEMOVE:
+        case WM_LBUTTONDOWN:
+        case WM_LBUTTONUP:
+        case WM_LBUTTONDBLCLK:
+        case WM_MBUTTONDOWN:
+        case WM_MBUTTONUP:
+        case WM_MBUTTONDBLCLK:
+        case WM_RBUTTONDOWN:
+        case WM_RBUTTONUP:
+        case WM_RBUTTONDBLCLK:
+            SendMessage(WinID, message, wParam, lParam);
+    }
     
     return DefWindowProc(hWnd, message, wParam, lParam);
 }
@@ -361,7 +375,7 @@
         mplayerIcon = LoadIcon(0, IDI_APPLICATION);
 
   {
-    WNDCLASSEX wcex = { sizeof wcex, CS_OWNDC, WndProc, 0, 0, hInstance, mplayerIcon, LoadCursor(0, IDC_ARROW), (HBRUSH)GetStockObject(BLACK_BRUSH), 0, classname, mplayerIcon };
+    WNDCLASSEX wcex = { sizeof wcex, CS_OWNDC | CS_DBLCLKS, WndProc, 0, 0, hInstance, mplayerIcon, LoadCursor(0, IDC_ARROW), (HBRUSH)GetStockObject(BLACK_BRUSH), 0, classname, mplayerIcon };
 
     if (!RegisterClassEx(&wcex)) {
         mp_msg(MSGT_VO, MSGL_ERR, "vo: win32: unable to register window class!\n");