Questions about XEmbedding a widget using C and Gtk

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
otacon14112

Questions about XEmbedding a widget using C and Gtk

Post by otacon14112 »

If you want to embed another application's widget into your application,
according to https://developer.gnome.org/gtk3/stable/GtkSocket.html you create
a socket widget, get its window ID with gtk_socket_get_id (), and then pass that
to the other application. Then the other application is supposed to put its
widget into a plug, which causes the widget to appear in your application's
socket.

Also, according to https://standards.freedesktop.org/xembe ... #lifecycle
the XEmbed protocol is started by the embedder (application with the socket),
and the window ID of the plug is sent to the embedder, which calls XReparentWindow(),
to embed the widget contained in the plug into the socket.

I only want to embed a widget from the current active application window. So,
for example, if it's minimized or closed, another app or window becomes the new
active window. I want to always have a widget from whatever is the active
app/window.

But I have some questions:

1.1 Do I have to make my socket app send its ID, or does the win mgr take care of it?
1.2 If my socket app has to send its ID to the other app, how do I know who to send it to?
2. If my socket app has to know which window/app is the current active one, how does it do it?

Thanks in advance
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Locked

Return to “Other topics”