[vlc-commits] Correctly update UI after media change

Daniel Amm git at videolan.org
Mon Sep 26 10:09:39 CEST 2016


npapi-vlc | branch: master | Daniel Amm <da2424 at t-online.de> | Mon Sep 26 10:09:03 2016 +0200| [e3a92482c4fb16e3bfc7d27f01aaaf6b311eb952] | committer: Jean-Baptiste Kempf

Correctly update UI after media change

Close #14660

> https://code.videolan.org/videolan/npapi-vlc/commit/e3a92482c4fb16e3bfc7d27f01aaaf6b311eb952
---

 common/win32_fullscreen.cpp | 10 ++++++++--
 common/win32_fullscreen.h   |  1 +
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/common/win32_fullscreen.cpp b/common/win32_fullscreen.cpp
index 7cbafe6..a11b2fe 100644
--- a/common/win32_fullscreen.cpp
+++ b/common/win32_fullscreen.cpp
@@ -566,11 +566,17 @@ LRESULT VLCHolderWnd::WindowProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
                 DWORD s = GetWindowLong(hwnd, GWL_STYLE);
                 s |= WS_CLIPSIBLINGS;
                 SetWindowLong(hwnd, GWL_STYLE, s);
-                // Now we can hook onto the media player's HWND:
-                MouseHook(true);
+
+                //libvlc events arrives from separate thread,
+                //so we need post message to main thread, to notify it.
+                PostMessage(hWnd(), WM_SET_MOUSE_HOOK, 0, 0);
             });
             break;
         }
+        case WM_SET_MOUSE_HOOK:{
+            MouseHook(true);
+            break;
+        }
         case WM_PAINT:{
             PAINTSTRUCT PaintStruct;
             HDC hDC = BeginPaint(hWnd(), &PaintStruct);
diff --git a/common/win32_fullscreen.h b/common/win32_fullscreen.h
index 1bd65be..c87f5e7 100644
--- a/common/win32_fullscreen.h
+++ b/common/win32_fullscreen.h
@@ -33,6 +33,7 @@
 enum{
     WM_MOUSE_EVENT_NOTIFY = WM_APP + 1,
     WM_MOUSE_EVENT_REPOST,
+    WM_SET_MOUSE_HOOK,
     WM_MOUSE_EVENT_NOTIFY_SUCCESS = 0xFF
 };
 



More information about the vlc-commits mailing list