Commit f1582740 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Reparenting does not work with set_parent.

It did not work in 1.0 either, and it was not safe in earlier versions.
Nobody ever bothered to implement thread-safe reparenting. Calling
libvlc_video_set_parent() is useless in 1.0: It has the same effect
as calling proper libvlc_media_player_set_*(), which the Mozilla
plugin already does.
parent cb7a32f4
...@@ -387,12 +387,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -387,12 +387,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
{ {
/* check if plugin has a new parent window */ /* check if plugin has a new parent window */
CGrafPtr drawable = (((NP_Port*) (window->window))->port); CGrafPtr drawable = (((NP_Port*) (window->window))->port);
if( !curwin.window || drawable != (((NP_Port*) (curwin.window))->port) )
{
/* set/change parent window */
libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, &ex);
libvlc_exception_clear(&ex);
}
/* as MacOS X video output is windowless, set viewport */ /* as MacOS X video output is windowless, set viewport */
libvlc_rectangle_t view, clip; libvlc_rectangle_t view, clip;
...@@ -422,9 +416,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -422,9 +416,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
else if( curwin.window ) else if( curwin.window )
{ {
/* change/set parent */ /* change/set parent */
libvlc_video_set_parent(p_vlc, 0, &ex);
libvlc_exception_clear(&ex);
curwin.window = NULL; curwin.window = NULL;
} }
#endif /* XP_MACOSX */ #endif /* XP_MACOSX */
...@@ -457,10 +448,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -457,10 +448,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS; style |= WS_CLIPCHILDREN|WS_CLIPSIBLINGS;
SetWindowLong((HWND)drawable, GWL_STYLE, style); SetWindowLong((HWND)drawable, GWL_STYLE, style);
/* change/set parent */
libvlc_video_set_parent(p_vlc, (libvlc_drawable_t)drawable, &ex);
libvlc_exception_clear(&ex);
/* remember new window */ /* remember new window */
p_plugin->setWindow(*window); p_plugin->setWindow(*window);
...@@ -476,10 +463,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -476,10 +463,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) ); SetWindowLong( oldwin, GWL_WNDPROC, (LONG)(p_plugin->getWindowProc()) );
p_plugin->setWindowProc(NULL); p_plugin->setWindowProc(NULL);
/* change/set parent */
libvlc_video_set_parent(p_vlc, 0, &ex);
libvlc_exception_clear(&ex);
curwin.window = NULL; curwin.window = NULL;
} }
#endif /* XP_WIN */ #endif /* XP_WIN */
...@@ -529,10 +512,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -529,10 +512,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
XtAddEventHandler( w, ButtonReleaseMask, FALSE, XtAddEventHandler( w, ButtonReleaseMask, FALSE,
(XtEventHandler)ControlHandler, p_plugin ); (XtEventHandler)ControlHandler, p_plugin );
/* set/change parent window */
libvlc_video_set_parent( p_vlc, (libvlc_drawable_t) video, &ex );
libvlc_exception_clear(&ex);
/* remember window */ /* remember window */
p_plugin->setWindow( *window ); p_plugin->setWindow( *window );
p_plugin->setVideoWindow( video ); p_plugin->setVideoWindow( video );
...@@ -553,9 +532,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window ) ...@@ -553,9 +532,6 @@ NPError NPP_SetWindow( NPP instance, NPWindow* window )
} }
else if( curwin.window ) else if( curwin.window )
{ {
/* change/set parent */
libvlc_video_set_parent(p_vlc, 0, &ex);
libvlc_exception_clear(&ex);
curwin.window = NULL; curwin.window = NULL;
} }
#endif /* XP_UNIX */ #endif /* XP_UNIX */
......
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