[vlc-devel] [PATCH 6/7] npapi win32: removed replacing mozilla window's window proc.

Sergey Radionov rsatom at gmail.com
Sat Dec 24 02:17:13 CET 2011


since:
a) any painting on it is never visible, because it is under holder window.
b) mozilla window can't recive mouse input, because all mouse input catched by holder window.
---
 npapi/vlcplugin_win.cpp |   59 -----------------------------------------------
 npapi/vlcplugin_win.h   |    6 ----
 2 files changed, 0 insertions(+), 65 deletions(-)

diff --git a/npapi/vlcplugin_win.cpp b/npapi/vlcplugin_win.cpp
index 2b82953..a8f09f9 100644
--- a/npapi/vlcplugin_win.cpp
+++ b/npapi/vlcplugin_win.cpp
@@ -24,49 +24,8 @@ BOOL WINAPI DllMain(HANDLE hModule, DWORD fdwReason, LPVOID lpReserved )
 };
 
 
-static LRESULT CALLBACK Manage( HWND p_hwnd, UINT i_msg, WPARAM wpar, LPARAM lpar )
-{
-    VlcPluginWin *p_plugin = reinterpret_cast<VlcPluginWin *>(GetWindowLongPtr(p_hwnd, GWLP_USERDATA));
-
-    switch( i_msg )
-    {
-        case WM_ERASEBKGND:
-            return 1L;
-
-        case WM_PAINT:
-        {
-            PAINTSTRUCT paintstruct;
-            HDC hdc;
-            RECT rect;
-
-            hdc = BeginPaint( p_hwnd, &paintstruct );
-
-            GetClientRect( p_hwnd, &rect );
-
-            FillRect( hdc, &rect, (HBRUSH)GetStockObject(BLACK_BRUSH) );
-            SetTextColor(hdc, RGB(255, 255, 255));
-            SetBkColor(hdc, RGB(0, 0, 0));
-            if( p_plugin->psz_text )
-                DrawText( hdc, p_plugin->psz_text, strlen(p_plugin->psz_text), &rect,
-                          DT_CENTER|DT_VCENTER|DT_SINGLELINE);
-
-            EndPaint( p_hwnd, &paintstruct );
-            return 0L;
-        }
-        case WM_LBUTTONDBLCLK:{
-            p_plugin->toggle_fullscreen();
-            return 0L;
-        }
-        default:
-            /* delegate to default handler */
-            return CallWindowProc( p_plugin->getWindowProc(), p_hwnd,
-                                   i_msg, wpar, lpar );
-    }
-}
-
 VlcPluginWin::VlcPluginWin(NPP instance, NPuint16_t mode) :
     VlcPluginBase(instance, mode),
-    pf_wndproc(NULL),
     _WindowsManager(DllGetModule())
 {
 }
@@ -119,10 +78,6 @@ bool VlcPluginWin::create_windows()
     SetWindowLongPtr(drawable, GWLP_USERDATA,
                      (LONG_PTR)this);
 
-    /* install our WNDPROC */
-    setWindowProc( (WNDPROC)SetWindowLongPtr( drawable,
-                                     GWLP_WNDPROC, (LONG_PTR)Manage ) );
-
     /* change window style to our liking */
     LONG style = GetWindowLong(drawable, GWL_STYLE);
     style |= WS_CLIPCHILDREN | WS_CLIPSIBLINGS;
@@ -148,20 +103,6 @@ bool VlcPluginWin::resize_windows()
 bool VlcPluginWin::destroy_windows()
 {
     _WindowsManager.DestroyWindows();
-
-    HWND oldwin = (HWND)npwindow.window;
-    if( oldwin )
-    {
-        WNDPROC winproc = getWindowProc();
-        if( winproc )
-        {
-            /* reset WNDPROC */
-            SetWindowLongPtr( oldwin, GWLP_WNDPROC, (LONG_PTR)winproc );
-            setWindowProc(NULL);
-        }
-        npwindow.window = NULL;
-    }
-
     return true;
 }
 
diff --git a/npapi/vlcplugin_win.h b/npapi/vlcplugin_win.h
index 5c1206d..255219f 100644
--- a/npapi/vlcplugin_win.h
+++ b/npapi/vlcplugin_win.h
@@ -57,11 +57,6 @@ public:
     void update_controls();
     void popup_menu(){};
 
-    WNDPROC             getWindowProc()
-                            { return pf_wndproc; };
-    void                setWindowProc(WNDPROC wndproc)
-                            { pf_wndproc = wndproc; };
-
 protected:
     virtual void on_media_player_new();
     virtual void on_media_player_release();
@@ -72,7 +67,6 @@ private:
     unsigned int     i_width, i_height;
     unsigned int     i_tb_width, i_tb_height;
 
-    WNDPROC pf_wndproc;
     VLCWindowsManager _WindowsManager;
 
     int i_last_position;
-- 
1.7.7.1.msysgit.0




More information about the vlc-devel mailing list