map and unmap work great now yay

This commit is contained in:
Dana Jansens 2002-12-04 01:29:01 +00:00
parent 9860b76c50
commit bdc491ccfe
5 changed files with 16 additions and 0 deletions

View file

@ -34,6 +34,7 @@ void OtkEventDispatcher::clearHandler(Window id)
_map.erase(id); _map.erase(id);
} }
#include <stdio.h>
void OtkEventDispatcher::dispatchEvents(void) void OtkEventDispatcher::dispatchEvents(void)
{ {
XEvent e; XEvent e;
@ -43,6 +44,10 @@ void OtkEventDispatcher::dispatchEvents(void)
while (XPending(OBDisplay::display)) { while (XPending(OBDisplay::display)) {
XNextEvent(OBDisplay::display, &e); XNextEvent(OBDisplay::display, &e);
#ifdef DEBUG
printf("Event %d window %lx\n", e.type, e.xany.window);
#endif
it = _map.find(e.xany.window); it = _map.find(e.xany.window);
if (it != _map.end()) if (it != _map.end())

View file

@ -832,6 +832,11 @@ void OBClient::unmapHandler(const XUnmapEvent &e)
printf("UnmapNotify for 0x%lx\n", e.window); printf("UnmapNotify for 0x%lx\n", e.window);
#endif // DEBUG #endif // DEBUG
if (ignore_unmaps) {
ignore_unmaps--;
return;
}
OtkEventHandler::unmapHandler(e); OtkEventHandler::unmapHandler(e);
// this deletes us etc // this deletes us etc

View file

@ -260,6 +260,7 @@ void Openbox::addClient(Window window, OBClient *client)
void Openbox::removeClient(Window window) void Openbox::removeClient(Window window)
{ {
_clients[window] = 0;
ClientMap::iterator it = _clients.find(window); ClientMap::iterator it = _clients.find(window);
if (it != _clients.end()) if (it != _clients.end())
_clients.erase(it); _clients.erase(it);

View file

@ -100,7 +100,10 @@ void OBRootWindow::mapRequestHandler(const XMapRequestEvent &e)
OBClient *client = Openbox::instance->findClient(e.window); OBClient *client = Openbox::instance->findClient(e.window);
printf("Client: %lx\n", client);
if (client) { if (client) {
printf("found client\n");
// XXX: uniconify and/or unshade the window // XXX: uniconify and/or unshade the window
} else { } else {
Openbox::instance->screen(_info->getScreenNumber())-> Openbox::instance->screen(_info->getScreenNumber())->

View file

@ -387,6 +387,8 @@ void OBScreen::unmanageWindow(OBClient *client)
// XXX: pass around focus if this window was focused // XXX: pass around focus if this window was focused
// remove from the wm's map
Openbox::instance->removeClient(client->window());
// unregister for handling events // unregister for handling events
Openbox::instance->clearHandler(client->window()); Openbox::instance->clearHandler(client->window());