LOGIN / SIGN UP
This should probably fix #38 (vnc issue).
2008-10-10 17:01 dbee6..38580
    Longer explanation (as far as I understand it):
    A client that uses the "Locally Active" input model (see ICCCM 2.0 ยง4.1.7)
    may delegate its input focus to one of its subwindows. If this happens,
    a FocusOut event for the top level window is generated but pekwm does not
    get the FocusIn event for the subwindow (because it is not managed by
    pekwm ?!). WindowManager::handleFocusOutEvent() then gives the input focus
    to the root window and thereby removing the input focus from the client
    completely.

src/WindowManager.cc
 
1486 @@ -1486,9 +1486,6 @@
1486 return;
1487 }
1488
1489 // Get the last focus in event, no need to go through them all.
1490 while (XCheckTypedEvent(_screen->getDpy(), FocusIn, (XEvent *) ev));
1491
1492 PWinObj *wo = PWinObj::findPWinObj(ev->window);
1493 if (wo) {
1494 // To simplify logic, changing client in frame wouldn't update the
...
1530 @@ -1533,17 +1530,15 @@
1530 if (wo->getType() == PWinObj::WO_CLIENT) {
1531 wo->getParent()->setFocused(true);
1532 setEwmhActiveWindow(wo->getWindow());
1533 static_cast<Client *>(wo)->sendTakeFocusMessage();
1534
1535 // update the MRU list
1536 _mru_list.remove(wo->getParent());
1537 _mru_list.push_back(wo->getParent());
1538 } else {
1539 wo->setFocused(true);
1540 setEwmhActiveWindow(None);
1541 }
1545
1546 // update the MRU list
1547 if (wo->getType() == PWinObj::WO_CLIENT) {
1548 _mru_list.remove(wo->getParent());
1549 _mru_list.push_back(wo->getParent());
1550 }
1548 }
1549 }
1550 }
...
1547 @@ -1552,27 +1547,9 @@
1547 void
1548 WindowManager::handleFocusOutEvent(XFocusChangeEvent *ev)
1549 {
1555 if ((ev->mode == NotifyGrab) || (ev->mode == NotifyUngrab)) {
1556 return;
1557 }
1558
1554 // Get the last focus in event, no need to go through them all.
1555 while (XCheckTypedEvent(_screen->getDpy(), FocusOut, (XEvent *) ev))
1556 ;
1562
1563 // Match against focusd PWinObj if any, if matches we see if
1564 // there are any FocusIn events in the queue, if not we give focus to
1565 // the root window as we don't want to get left without focus.
1566 if (PWinObj::getFocusedPWinObj()
1567 && (*PWinObj::getFocusedPWinObj() == ev->window)) {
1568 if (XCheckTypedEvent(_screen->getDpy(), FocusIn, (XEvent *) ev)) {
1569 // We found a Event, put it back and handle it later on.
1570 XPutBackEvent(_screen->getDpy(), (XEvent *) ev);
1571 } else {
1572 // No event found, give the root PWinObj focus.
1573 PWinObj::getRootPWinObj()->giveInputFocus();
1574 }
1575 }
1571 }
1572
1573 void
...