开发者

Xlib getting events of a child window

开发者 https://www.devze.com 2023-01-12 03:45 出处:网络
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 p

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.


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消