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 please read how to get help
Post Reply
User avatar
Level 2
Level 2
Posts: 64
Joined: Sun Apr 21, 2013 11:43 pm

Questions about XEmbedding a widget using C and Gtk

Post by otacon14112 » Tue Dec 05, 2017 12:19 am

If you want to embed another application's widget into your application,
according to 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

Also, according to ... #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

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
Otacon: You remember pre-ripped jeans? Manufacturers thought that just because people loved old, broken-in jeans, they would want to buy new jeans that looked old. So they purposefully...
Solid Snake: What do jeans have to do with nature and order?

Post Reply

Return to “Other topics”