问题描述
FvwmButtons(fvwm窗口管理器的模块)具有Swallow功能,该功能可以嵌入将应用程序的窗口插入面板.
FvwmButtons (a module of fvwm window manager) has the Swallow function, that embedsthe window of an application into a panel.
我必须对Motif和Xlib做类似的事情.我想将Xclock嵌入到我的应用程序中.我想我必须更改嵌入式应用程序的窗口ID.
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.
我该怎么做?
推荐答案
唯一受支持和可靠的机制是XEmbed,但它需要嵌入式应用程序进行协作.没有协作的应用程序,您将陷入可怕的黑客世界.
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.
您需要做的最基本的事情是XReparentWindow(),但是问题是您在与窗口管理器作斗争,而窗口管理器也希望重新创建窗口.您还可能会混淆该应用程序,它将期望ICCCM和EWMH行为,并且期望父窗口是WM框架.
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.
gnome面板的真正老版本GNOME 1.x具有吞咽功能,您可以尝试从中窃取hacks.
Really old GNOME 1.x versions of gnome panel had a swallow feature you could try to steal hacks from maybe.
如果没有相当广泛的X知识,这将是痛苦的,甚至并不一定能使它100%可靠.
Without pretty extensive X knowledge this will be painful, and evenwith it's not necessarily possible to make 100% reliable.
这篇关于将应用程序嵌入到窗口中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!