Xlib 获取子窗口的事件

发布于 2024-09-15 01:25:27 字数 187 浏览 4 评论 0原文

我正在使用 xlib 编写一个简单的窗口管理器。该代码将客户端窗口重新设置为比客户端窗口稍大的窗口,称为框架窗口。我正在尝试实施点击聚焦政策。当在框架窗口中按下鼠标按钮时,我收到按钮按下事件,并且能够在按下按钮时升起框架窗口。但是,当在客户端窗口中按下鼠标按钮时,我没有收到任何事件。这个想法是捕获此事件并提升框架窗口,即使在客户端窗口中按下鼠标按钮也是如此。

I am writing a simple window manager using xlib. The code reparents client windows into a window slightly larger than the client window called frame window. I am trying to implement a click to focus policy. I am getting buttonpress events when the mouse button is pressed in the frame window and am able to raise the frame window on buttonpress. However, I am not getting any events when the mouse button is pressed in the client window. The idea is to trap this event and raise the frame window even when the mouse button is pressed in the client window.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

勿忘初心 2024-09-22 01:25:27

您必须在子窗口上使用 XGrabButton() 。您的下一个问题是,当按下按钮时,子窗口会失去焦点;您可能想保留自己对“焦点窗口”的想法,而不是在详细信息 = NotifyGrab 事件上更改它。例如,请参阅 Metacity 源代码。

You have to XGrabButton() on the child window. Your next problem will be that when the button is pressed the child window loses focus; you probably want to keep your own idea of the "focus window" and not change it on detail=NotifyGrab events. See metacity source code for example.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文