Example #1
0
void Kernel::handleMotionNotify(XMotionEvent *event) {

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

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

    Thing *thing = thingWindow(event->window);
    if (thing) {
        if (!thing->isFocused() && isSloppyMode_) {
            Workspace *workspace = focusedMonitor()->focused();
            workspace->focus(thing, false);
        }
        thing->handleMotionNotify(event);
    }

    // focusses the monitor if multihead
    isRootWindow(event->root);
}
Example #2
0
void Kernel::selectMonitor(string displayString) {

    for (LMonitor::iterator it = monitors_->begin();
            it != monitors_->end(); it++)
    {
        Monitor *monitor = *it;
        if (monitor->displayString() == displayString) {
            if (monitors_->focused() != monitor) {
                XCORE->warpPointer(monitor->rootWindow(),
                                   monitor->width() / 2,
                                   monitor->height() / 2);
                monitors_->focus(monitor);
                Workspace *ws = monitor->focused();
                ws->focus(ws->topClient());
            }
            return;
        }
    }
}