From: Dana Jansens Date: Wed, 4 Dec 2002 01:29:01 +0000 (+0000) Subject: map and unmap work great now yay X-Git-Url: https://git.brokenzipper.com/gitweb?a=commitdiff_plain;ds=sidebyside;h=bdc491ccfe71ce29a5a1ea813da4b1c66e2fa330;p=chaz%2Fopenbox map and unmap work great now yay --- diff --git a/otk/eventdispatcher.cc b/otk/eventdispatcher.cc index 2a0c4448..5be1c6b1 100644 --- a/otk/eventdispatcher.cc +++ b/otk/eventdispatcher.cc @@ -34,6 +34,7 @@ void OtkEventDispatcher::clearHandler(Window id) _map.erase(id); } +#include void OtkEventDispatcher::dispatchEvents(void) { XEvent e; @@ -43,6 +44,10 @@ void OtkEventDispatcher::dispatchEvents(void) while (XPending(OBDisplay::display)) { XNextEvent(OBDisplay::display, &e); +#ifdef DEBUG + printf("Event %d window %lx\n", e.type, e.xany.window); +#endif + it = _map.find(e.xany.window); if (it != _map.end()) diff --git a/src/client.cc b/src/client.cc index 4fc8ef97..aef3dcba 100644 --- a/src/client.cc +++ b/src/client.cc @@ -832,6 +832,11 @@ void OBClient::unmapHandler(const XUnmapEvent &e) printf("UnmapNotify for 0x%lx\n", e.window); #endif // DEBUG + if (ignore_unmaps) { + ignore_unmaps--; + return; + } + OtkEventHandler::unmapHandler(e); // this deletes us etc diff --git a/src/openbox.cc b/src/openbox.cc index 0c534a0f..72c603f2 100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@ -260,6 +260,7 @@ void Openbox::addClient(Window window, OBClient *client) void Openbox::removeClient(Window window) { + _clients[window] = 0; ClientMap::iterator it = _clients.find(window); if (it != _clients.end()) _clients.erase(it); diff --git a/src/rootwindow.cc b/src/rootwindow.cc index ff8a644f..a028ac81 100644 --- a/src/rootwindow.cc +++ b/src/rootwindow.cc @@ -100,7 +100,10 @@ void OBRootWindow::mapRequestHandler(const XMapRequestEvent &e) OBClient *client = Openbox::instance->findClient(e.window); + printf("Client: %lx\n", client); + if (client) { + printf("found client\n"); // XXX: uniconify and/or unshade the window } else { Openbox::instance->screen(_info->getScreenNumber())-> diff --git a/src/screen.cc b/src/screen.cc index 01abd83c..22d5d1be 100644 --- a/src/screen.cc +++ b/src/screen.cc @@ -387,6 +387,8 @@ void OBScreen::unmanageWindow(OBClient *client) // XXX: pass around focus if this window was focused + // remove from the wm's map + Openbox::instance->removeClient(client->window()); // unregister for handling events Openbox::instance->clearHandler(client->window());