mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-03 14:08:56 +00:00
ximagesink, xvimagesink: set the _NET_WM_PID atom on the window
This makes it easier for X11 window management to work with windows created by these sinks Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3267>
This commit is contained in:
parent
8a8fe360a2
commit
990d124790
2 changed files with 17 additions and 0 deletions
|
@ -112,6 +112,9 @@
|
||||||
/* Debugging category */
|
/* Debugging category */
|
||||||
#include <gst/gstinfo.h>
|
#include <gst/gstinfo.h>
|
||||||
|
|
||||||
|
/* For getpid */
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
/* for XkbKeycodeToKeysym */
|
/* for XkbKeycodeToKeysym */
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
|
@ -433,6 +436,12 @@ gst_x_image_sink_xwindow_set_title (GstXImageSink * ximagesink,
|
||||||
XSetClassHint (ximagesink->xcontext->disp, xwindow->win, hint);
|
XSetClassHint (ximagesink->xcontext->disp, xwindow->win, hint);
|
||||||
}
|
}
|
||||||
XFree (hint);
|
XFree (hint);
|
||||||
|
|
||||||
|
unsigned long pid = getpid ();
|
||||||
|
Atom _NET_WM_PID =
|
||||||
|
XInternAtom (ximagesink->xcontext->disp, "_NET_WM_PID", 0);
|
||||||
|
XChangeProperty (ximagesink->xcontext->disp, xwindow->win,
|
||||||
|
_NET_WM_PID, _NET_WM_PID, 32, 0, (unsigned char *) &pid, 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,6 +30,9 @@
|
||||||
/* Debugging category */
|
/* Debugging category */
|
||||||
#include <gst/gstinfo.h>
|
#include <gst/gstinfo.h>
|
||||||
|
|
||||||
|
/* for getpid */
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
/* for XkbKeycodeToKeysym */
|
/* for XkbKeycodeToKeysym */
|
||||||
#include <X11/XKBlib.h>
|
#include <X11/XKBlib.h>
|
||||||
|
|
||||||
|
@ -1039,6 +1042,11 @@ gst_xvcontext_create_xwindow (GstXvContext * context, gint width, gint height)
|
||||||
g_free (hints);
|
g_free (hints);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long pid = getpid ();
|
||||||
|
Atom _NET_WM_PID = XInternAtom (context->disp, "_NET_WM_PID", 0);
|
||||||
|
XChangeProperty (context->disp, window->win,
|
||||||
|
_NET_WM_PID, _NET_WM_PID, 32, 0, (unsigned char *) &pid, 1);
|
||||||
|
|
||||||
window->gc = XCreateGC (context->disp, window->win, 0, NULL);
|
window->gc = XCreateGC (context->disp, window->win, 0, NULL);
|
||||||
|
|
||||||
XMapRaised (context->disp, window->win);
|
XMapRaised (context->disp, window->win);
|
||||||
|
|
Loading…
Reference in a new issue