What I need is to get the
Window Id of the
browser in case of playing vlc as plugin OR the
window id of
vlc-player in case I am playing video as in normal player. The code to get the IDs (root,children,parent) depends on the location of function call XQueryTree()....I dont know where I can get the appropriate information ....i am rightnow calling this in ToggleFullScreen where I am getting a BadWindow error ...that obviously means the window after going into fullscreen maybe loses its parent window-id....but i am not sure yet....
Is there any other way I can get the WindowId of the parent of fullscreen video window ???
any feedback would be appreciated.
//xcommon.c
static void ToggleFullScreen ( vout_thread_t *p_vout )
{
Atom prop;
XEvent xevent;
mwmhints_t mwmhints;
XSetWindowAttributes attributes;
#ifdef HAVE_XINERAMA
int i_d1, i_d2;
#endif
p_vout->b_fullscreen = !p_vout->b_fullscreen;
if( p_vout->b_fullscreen )
{
...............
...............
............... //finishes making fullscreen
Window parent;
Window root;
Window *child_list;
unsigned int num_children;
Window child;
int i;
Display * dpy = p_vout->p_sys->p_display;
XGetInputFocus(dpy, &child, &i);
XQueryTree(dpy, child, &root, &parent, &child_list, &num_children); //BADWINDOW
if(parent==root)
return child;
while(parent!=root)
{
child = parent;
if (!XQueryTree(dpy, child, &root, &parent, &child_list,
&num_children))
printf("Can't query window tree.");
}
}else{
}