Xlib 获取子窗口的事件
我正在使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您必须在子窗口上使用 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.