d3d11window_win32: Chain up mouse event to parent window
authorSeungha Yang <seungha@centricular.com>
Mon, 22 Jun 2020 09:42:45 +0000 (18:42 +0900)
committerGStreamer Merge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Mon, 22 Jun 2020 15:09:22 +0000 (15:09 +0000)
Unlike key event, mouse event will not be chained up to parent window
by DefWindowProc

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/1361>

sys/d3d11/gstd3d11window_win32.cpp

index d79a7da..012ce6a 100644 (file)
@@ -600,7 +600,13 @@ gst_d3d11_window_win32_handle_window_proc (GstD3D11WindowWin32 * self,
     case WM_MBUTTONDOWN:
     case WM_MBUTTONUP:
     case WM_MOUSEMOVE:
-      gst_d3d11_window_win32_on_mouse_event (self, hWnd, uMsg, wParam, lParam);
+      /* To handle mouse event only once, do this only for internal window */
+      if (self->internal_hwnd && self->internal_hwnd == hWnd)
+        gst_d3d11_window_win32_on_mouse_event (self, hWnd, uMsg, wParam, lParam);
+
+      /* DefWindowProc will not chain up mouse event to parent window */
+      if (self->external_hwnd && self->external_hwnd != hWnd)
+        SendMessage (self->external_hwnd, uMsg, wParam, lParam);
       break;
     case WM_SYSKEYDOWN:
       if ((window->fullscreen_toggle_mode &