eryang_Li
(eryang Li)
March 11, 2023, 10:56am
1
I want to embed the X11 window created by the following code into Gtk4, but I can’t find any reference in Gtk4.
display = XOpenDisplay(NULL);
int screen = DefaultScreen(display);
unsigned int width = DisplayWidth(display, screen);
unsigned int height = DisplayHeight(display, screen);
window = XCreateSimpleWindow(display, DefaultRootWindow(display), 100, 100, width, height, 0, 0, 0);
XMapWindow(display, window);
ebassi
(Emmanuele Bassi)
March 11, 2023, 12:35pm
2
The short answer is: you don’t.
The longer answer requires asking the question: what are you actually trying to achieve, and why are you using X11 to achieve it?
eryang_Li
(eryang Li)
March 11, 2023, 1:21pm
3
ebassi:
achieve
My implementation: Running a GStreamer pipeline in another process, ultimately using nveglglessink for rendering. I want to display the X11 window of this sink to GTK4.
I know it can be done with egl context and GtkPaintable, but this part takes a lot of time to learn, and I don’t have enough time to learn this part right now. I want to embed the X11 window directly into GTK4.
ebassi
(Emmanuele Bassi)
March 11, 2023, 1:23pm
4
eryang_Li:
I know it can be done with egl context and GtkPaintable, but this part takes a lot of time to learn, and I don’t have enough time to learn this part right now. I want to embed the X11 window directly into GTK4.
There’s a reason why the support exists for EGL and GdkPaintable: it’s because you cannot do it with X11 and embedding random window XIDs into GTK4.
eryang_Li
(eryang Li)
March 11, 2023, 1:25pm
5
Can I do this by using gtk4paintablesink?
system
(system)
Closed
April 25, 2023, 1:26pm
6
This topic was automatically closed 45 days after the last reply. New replies are no longer allowed.