window_x11->running = TRUE;
window_x11->visible = FALSE;
- window_x11->parent_win = 0;
window_x11->allow_extra_expose_events = TRUE;
g_assert (window_x11->device);
unsigned long mask;
const gchar *title = "OpenGL renderer";
Atom wm_atoms[1];
-
- static gint x = 0;
- static gint y = 0;
+ gint x = 0, y = 0, width = 1, height = 1;
if (window_x11->visual_info->visual != window_x11->visual)
GST_LOG ("selected visual is different from the default");
mask = CWBackPixmap | CWBorderPixel | CWColormap | CWEventMask;
- x += 20;
- y += 20;
-
window_x11->internal_win_id =
- XCreateWindow (window_x11->device, window_x11->root, x, y, 1, 1, 0,
+ XCreateWindow (window_x11->device,
+ window_x11->parent_win ? window_x11->parent_win : window_x11->root,
+ x, y, width, height, 0,
window_x11->visual_info->depth, InputOutput,
window_x11->visual_info->visual, mask, &win_attr);
GST_GL_WINDOW_LOCK (window_x11);
- window_x11->parent_win = 0;
if (window_x11->device) {
if (window_x11->internal_win_id)
XUnmapWindow (window_x11->device, window_x11->internal_win_id);
window_x11->parent_win = (Window) id;
- GST_LOG ("set parent window id: %lud", id);
+ if (window_x11->running) {
+ GST_LOG ("set parent window id: %lud", id);
- XGetWindowAttributes (window_x11->disp_send, window_x11->parent_win, &attr);
+ XGetWindowAttributes (window_x11->disp_send, window_x11->parent_win, &attr);
- XResizeWindow (window_x11->disp_send, window_x11->internal_win_id, attr.width,
- attr.height);
+ XResizeWindow (window_x11->disp_send, window_x11->internal_win_id,
+ attr.width, attr.height);
- XReparentWindow (window_x11->disp_send, window_x11->internal_win_id,
- window_x11->parent_win, 0, 0);
+ XReparentWindow (window_x11->disp_send, window_x11->internal_win_id,
+ window_x11->parent_win, 0, 0);
- XSync (window_x11->disp_send, FALSE);
+ XSync (window_x11->disp_send, FALSE);
+ }
}
/* Called in the gl thread */