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.
A:
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.
Havoc P
2010-08-21 14:23:44