[vlc-commits] [Git][videolan/npapi-vlc][master] Correctly update UI after media change

Jean-Baptiste Kempf gitlab at videolan.org
Mon Sep 26 10:09:40 CEST 2016


Jean-Baptiste Kempf pushed to branch master at videolan / VLC Browser Plugins


Commits:
e3a92482 by Daniel Amm at 2016-09-26T10:09:03+02:00
Correctly update UI after media change

Close #14660

- - - - -


2 changed files:

- common/win32_fullscreen.cpp
- common/win32_fullscreen.h


Changes:

=====================================
common/win32_fullscreen.cpp
=====================================
--- 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);


=====================================
common/win32_fullscreen.h
=====================================
--- 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
 };
 



View it on GitLab: https://code.videolan.org/videolan/npapi-vlc/commit/e3a92482c4fb16e3bfc7d27f01aaaf6b311eb952
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.videolan.org/pipermail/vlc-commits/attachments/20160926/407efe74/attachment-0001.html>


More information about the vlc-commits mailing list