/* Shutdown X11 */ void X11_Shutdown (struct _video_out *vout) { X11VID (); if (xWindow->output_3d_mode==1) { #ifdef GPAC_HAS_OPENGL X11_ReleaseGL(xWindow); #endif } else { X11_ReleaseBackBuffer (vout); } #ifdef GPAC_HAS_OPENGL if (xWindow->glx_visualinfo) XFree(xWindow->glx_visualinfo); xWindow->glx_visualinfo = NULL; #endif XFreeGC (xWindow->display, xWindow->the_gc); XUnmapWindow (xWindow->display, (Window) xWindow->wnd); XDestroyWindow (xWindow->display, (Window) xWindow->wnd); XDestroyWindow (xWindow->display, (Window) xWindow->full_wnd); #ifdef GPAC_HAS_OPENGL if (xWindow->gl_offscreen) glXDestroyGLXPixmap(xWindow->display, xWindow->gl_offscreen); if (xWindow->gl_pixmap) XFreePixmap(xWindow->display, xWindow->gl_pixmap); XUnmapWindow (xWindow->display, (Window) xWindow->gl_wnd); XDestroyWindow (xWindow->display, (Window) xWindow->gl_wnd); #endif /*restore xscreen saver*/ X11_XScreenSaverState(xWindow, 1); XCloseDisplay (xWindow->display); gf_free(xWindow); }
/* switch from/to full screen mode */ GF_Err X11_SetFullScreen (struct _video_out * vout, u32 bFullScreenOn, u32 * screen_width, u32 * screen_height) { X11VID (); xWindow->fullscreen = bFullScreenOn; #ifdef GPAC_HAS_OPENGL if (xWindow->output_3d_mode==1) X11_ReleaseGL(xWindow); #endif if (bFullScreenOn) { xWindow->store_width = *screen_width; xWindow->store_height = *screen_height; xWindow->w_width = vout->max_screen_width; xWindow->w_height = vout->max_screen_height; XFreeGC (xWindow->display, xWindow->the_gc); xWindow->the_gc = XCreateGC (xWindow->display, xWindow->full_wnd, 0, NULL); XMoveResizeWindow (xWindow->display, (Window) xWindow->full_wnd, 0, 0, vout->max_screen_width, vout->max_screen_height); *screen_width = xWindow->w_width; *screen_height = xWindow->w_height; XUnmapWindow (xWindow->display, xWindow->wnd); XMapWindow (xWindow->display, xWindow->full_wnd); XSetInputFocus(xWindow->display, xWindow->full_wnd, RevertToNone, CurrentTime); XRaiseWindow(xWindow->display, xWindow->full_wnd); XGrabKeyboard(xWindow->display, xWindow->full_wnd, True, GrabModeAsync, GrabModeAsync, CurrentTime); } else { *screen_width = xWindow->store_width; *screen_height = xWindow->store_height; XFreeGC (xWindow->display, xWindow->the_gc); xWindow->the_gc = XCreateGC (xWindow->display, xWindow->wnd, 0, NULL); XUnmapWindow (xWindow->display, xWindow->full_wnd); XMapWindow (xWindow->display, xWindow->wnd); XUngrabKeyboard(xWindow->display, CurrentTime); /*looks like this makes osmozilla crash*/ //if (xWindow->par_wnd) XSetInputFocus(xWindow->display, xWindow->wnd, RevertToNone, CurrentTime); /*backbuffer resize will be done right after this is called */ } #ifdef GPAC_HAS_OPENGL if (xWindow->output_3d_mode==1) X11_SetupGL(vout); #endif return GF_OK; }
/* Shutdown X11 */ void X11_Shutdown (struct _video_out *vout) { X11VID (); if (xWindow->is_3D_out) { #ifdef GPAC_HAS_OPENGL X11_ReleaseGL(xWindow); #endif } else { X11_ReleaseBackBuffer (vout); } free(xWindow->back_buffer); XFreeGC (xWindow->display, xWindow->the_gc); XUnmapWindow (xWindow->display, (Window) xWindow->wnd); XDestroyWindow (xWindow->display, (Window) xWindow->wnd); XDestroyWindow (xWindow->display, (Window) xWindow->full_wnd); XCloseDisplay (xWindow->display); free (xWindow); }