Hi all.I would like to be able to raise the clicked window to the top of the 
stack on my window manager. But it fail because only one client can SelectInput 
on Button events at one time. How can I realize my goal? Here is my code :

#include <X11/Xlib.h>
int main(void)
{
    Display *display=XOpenDisplay(NULL);
    XSelectInput(display, DefaultRootWindow(display), 
SubstructureRedirectMask|SubstructureNotifyMask|ButtonPressMask|OwnerGrabButtonMask);
    XEvent event;
    while(1)
    {
        XNextEvent(display, &event);
        switch(event.type)
        {
            case ButtonPress :
                XRaiseWindow(display, event.xbutton.window);
                XSetInputFocus(display, event.xbutton.window, 
RevertToPointerRoot, CurrentTime);
                break;
            case ConfigureRequest :
                /* ... */
                break;
            case MapRequest :
                XMapWindow(display, event.xmaprequest.window);
                break;
        }
    }
    return 0;
}
_______________________________________________
xorg@lists.x.org: X.Org support
Archives: http://lists.freedesktop.org/archives/xorg
Info: https://lists.x.org/mailman/listinfo/xorg
Your subscription address: %(user_address)s

Reply via email to