Commit 3c202623 authored by Sergey Radionov's avatar Sergey Radionov Committed by Jean-Baptiste Kempf

npapi win32: removed replacing mozilla window's window proc.

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.
Signed-off-by: Jean-Baptiste Kempf's avatarJean-Baptiste Kempf <jb@videolan.org>
parent 5e054a87
......@@ -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;
}
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment