changeset 30465:3422423f2e20

Create the OpenGL probe window as a hidden Window on X11.
author reimar
date Thu, 04 Feb 2010 22:08:23 +0000
parents 33d58a8eaf09
children cd3f6962fcfd
files libvo/video_out.h libvo/vo_gl.c libvo/x11_common.c
diffstat 3 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/video_out.h	Thu Feb 04 21:20:47 2010 +0000
+++ b/libvo/video_out.h	Thu Feb 04 22:08:23 2010 +0000
@@ -108,6 +108,7 @@
 #define VOFLAG_MODESWITCHING	0x02
 #define VOFLAG_SWSCALE		0x04
 #define VOFLAG_FLIPPING		0x08
+#define VOFLAG_HIDDEN		0x10  //< Use to create a hidden window
 #define VOFLAG_XOVERLAY_SUB_VO  0x10000
 
 typedef struct vo_info_s
--- a/libvo/vo_gl.c	Thu Feb 04 21:20:47 2010 +0000
+++ b/libvo/vo_gl.c	Thu Feb 04 22:08:23 2010 +0000
@@ -1167,7 +1167,7 @@
     if (!init_mpglcontext(&glctx, gltype))
       goto err_out;
     if (use_yuv == -1) {
-      if (create_window(320, 200, 0, NULL) < 0)
+      if (create_window(320, 200, VOFLAG_HIDDEN, NULL) < 0)
         goto err_out;
       if (glctx.setGlWindow(&glctx) == SET_WINDOW_FAILED)
         goto err_out;
--- a/libvo/x11_common.c	Thu Feb 04 21:20:47 2010 +0000
+++ b/libvo/x11_common.c	Thu Feb 04 22:08:23 2010 +0000
@@ -104,6 +104,7 @@
 int vo_mouse_autohide = 0;
 int vo_wm_type = 0;
 int vo_fs_type = 0; // needs to be accessible for GUI X11 code
+static int window_state;
 static int vo_fs_flip = 0;
 char **vo_fstype_list;
 
@@ -1102,13 +1103,18 @@
     goto final;
   }
   if (vo_window == None) {
-    XSizeHints hint;
-    XEvent xev;
     vo_fs = 0;
     vo_dwidth = width;
     vo_dheight = height;
     vo_window = vo_x11_create_smooth_window(mDisplay, mRootWin, vis->visual,
                       x, y, width, height, vis->depth, col_map);
+    window_state = VOFLAG_HIDDEN;
+  }
+  if (flags & VOFLAG_HIDDEN)
+    goto final;
+  if (window_state & VOFLAG_HIDDEN) {
+    XSizeHints hint;
+    XEvent xev;
     vo_x11_classhint(mDisplay, vo_window, classname);
     XStoreName(mDisplay, vo_window, title);
     vo_hidecursor(mDisplay, vo_window);