mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
[278/906] Implement set_xwindow_id (gst_gl_window_set_external_window_id).
This commit is contained in:
parent
aab706c46c
commit
1daf54222f
1 changed files with 16 additions and 14 deletions
|
@ -392,23 +392,25 @@ gst_gl_window_error_quark (void)
|
||||||
void
|
void
|
||||||
gst_gl_window_set_external_window_id (GstGLWindow *window, guint64 id)
|
gst_gl_window_set_external_window_id (GstGLWindow *window, guint64 id)
|
||||||
{
|
{
|
||||||
/*stGLWindowPrivate *priv = window->priv;
|
g_debug ("SET EXTERNAL WIN IN\n");
|
||||||
WNDPROC window_parent_proc = (WNDPROC) (guint64) GetWindowLongPtr((HWND)id, GWL_WNDPROC);
|
if (window)
|
||||||
RECT rect;
|
{
|
||||||
|
GstGLWindowPrivate *priv = window->priv;
|
||||||
|
XWindowAttributes attr;
|
||||||
|
|
||||||
SetProp (priv->internal_win_id, "gl_window_parent_id", (HWND)id);
|
g_mutex_lock (priv->x_lock);
|
||||||
SetProp ((HWND)id, "gl_window_id", priv->internal_win_id);
|
|
||||||
SetProp ((HWND)id, "gl_window_parent_proc", (WNDPROC) window_parent_proc);
|
|
||||||
SetWindowLongPtr ((HWND)id, GWL_WNDPROC, (DWORD) (guint64) sub_class_proc);
|
|
||||||
|
|
||||||
SetWindowLongPtr (priv->internal_win_id, GWL_STYLE, WS_CHILD | WS_MAXIMIZE);
|
XGetWindowAttributes (priv->disp_send, (Window) id, &attr);
|
||||||
SetParent (priv->internal_win_id, (HWND)id);
|
|
||||||
|
|
||||||
//take changes into account: SWP_FRAMECHANGED
|
XResizeWindow (priv->disp_send, priv->internal_win_id, attr.width, attr.height);
|
||||||
GetClientRect ((HWND)id, &rect);
|
|
||||||
SetWindowPos (priv->internal_win_id, HWND_TOP, rect.left, rect.top, rect.right, rect.bottom,
|
XReparentWindow (priv->disp_send, priv->internal_win_id, (Window) id, attr.x, attr.y);
|
||||||
SWP_ASYNCWINDOWPOS | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED | SWP_NOACTIVATE);
|
|
||||||
MoveWindow (priv->internal_win_id, rect.left, rect.top, rect.right, rect.bottom, FALSE);*/
|
XSync (priv->disp_send, FALSE);
|
||||||
|
|
||||||
|
g_mutex_unlock (priv->x_lock);
|
||||||
|
}
|
||||||
|
g_debug ("SET EXTERNAL WIN OUT\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|
Loading…
Reference in a new issue