Beispiel #1
0
void Kernel::handleButtonPress(XButtonEvent *event) {

    event->state &= Binder::instance()->validModMask();

    if (event->state != 0) {
        // no AnyModifier, so this seems to be shortcut
        Binder::instance()->handleButton(event->root, event);
        return;
    }

    Menu *menu = menuWindow(event->window);
    if (menu) {
        menu->handleButtonPress(event);
        return;
    }

    Bar *bar = barWindow(event->window);
    if (bar) {
        bar->handleButtonPress(event);
        return;
    }

#ifdef SLOT_SUPPORT
    Slot *slot = slotWindow(event->window);
    if (slot) {
        slot->handleButtonPress(event);
        return;
    }
#endif

    Thing *thing = thingWindow(event->window);

    if (thing) {
        thing->handleButtonPress(event);
    }

    Client *client = clientForWindow(event->window);
    if (client) {
        client->handleButtonPress(event);
    }
}