Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embed an app into a window

FvwmButtons (a module of fvwm window manager) has the Swallow function, that embeds the window of an application into a panel.

I have to do something like this with Motif and Xlib. I want to embed an Xclock into my application. I guess I have to change the Window ID of the embedded app.

How can I do that?

like image 239
mghis Avatar asked Mar 22 '11 17:03

mghis


People also ask

How do I open an app in a new window?

If you hold down the Shift key on your keyboard while clicking on an app's taskbar icon, you'll launch a new window of that app instead of switching to the existing open window.


1 Answers

the only supported and reliable mechanism is XEmbed, but it requires the embedded app to cooperate. Without a cooperating app, you're in a world of scary hacks.

The basic thing you need to do is XReparentWindow() but the problem is that you're fighting the window manager which will also want to reparent the window. You're also potentially confusing the app, which will be expecting ICCCM and EWMH behavior, and expecting the parent window to be a WM frame.

Really old GNOME 1.x versions of gnome panel had a swallow feature you could try to steal hacks from maybe.

Without pretty extensive X knowledge this will be painful, and even with it's not necessarily possible to make 100% reliable.

like image 129
Havoc P Avatar answered Oct 05 '22 06:10

Havoc P