X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fclient.cc;h=e626081ce19e871a2fe37e25653f5f257ee69ed0;hb=4721c53868187d10e3732cea63efa9fbd352178d;hp=38364432418a019549dfad589163ec1a356631d4;hpb=3a4f91b53700093f6f577c309a746ede44652e4f;p=chaz%2Fopenbox diff --git a/src/client.cc b/src/client.cc index 38364432..e626081c 100644 --- a/src/client.cc +++ b/src/client.cc @@ -907,6 +907,11 @@ void OBClient::unfocusHandler(const XFocusChangeEvent &e) frame->unfocus(); _focused = false; + + if (Openbox::instance->focusedClient() == this) { + printf("UNFOCUSED!\n"); + Openbox::instance->setFocusedClient(this); + } } @@ -1002,4 +1007,26 @@ void OBClient::destroyHandler(const XDestroyWindowEvent &e) } +void OBClient::reparentHandler(const XReparentEvent &e) +{ + // this is when the client is first taken captive in the frame + if (e.parent == frame->plate()) return; + +#ifdef DEBUG + printf("ReparentNotify for 0x%lx\n", e.window); +#endif // DEBUG + + OtkEventHandler::reparentHandler(e); + + /* + This event is quite rare and is usually handled in unmapHandler. + However, if the window is unmapped when the reparent event occurs, + the window manager never sees it because an unmap event is not sent + to an already unmapped window. + */ + + // this deletes us etc + Openbox::instance->screen(_screen)->unmanageWindow(this); +} + }