]> Dogcows Code - chaz/openbox/commitdiff
add \n's to the signal printfs
authorDana Jansens <danakj@orodu.net>
Sun, 10 Nov 2002 08:34:46 +0000 (08:34 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 10 Nov 2002 08:34:46 +0000 (08:34 +0000)
make the hash of all clients destroy properly

src/frame.cc
src/openbox.cc

index 22249ce55762bf119be418811644633e3f76a975..9b454a5c6dd7516947d2d2aff55565e0dc697c73 100644 (file)
@@ -267,6 +267,8 @@ void OBFrame::update()
   // map/unmap all the windows
   if (_decorations & OBClient::Decor_Titlebar) {
     XMapWindow(otk::OBDisplay::display, _titlebar);
+    XSetWindowBorder(otk::OBDisplay::display, _titlebar,
+                     _style->getBorderWidth());
     XMapWindow(otk::OBDisplay::display, _label);
     if (_decorations & OBClient::Decor_Iconify)
       XMapWindow(otk::OBDisplay::display, _button_iconify);
@@ -295,8 +297,14 @@ void OBFrame::update()
 
   if (_decorations & OBClient::Decor_Handle) {
     XMapWindow(otk::OBDisplay::display, _handle);
+    XSetWindowBorder(otk::OBDisplay::display, _handle,
+                     _style->getBorderWidth());
     XMapWindow(otk::OBDisplay::display, _grip_left);
+    XSetWindowBorder(otk::OBDisplay::display, _grip_left,
+                     _style->getBorderWidth());
     XMapWindow(otk::OBDisplay::display, _grip_right);
+    XSetWindowBorder(otk::OBDisplay::display, _grip_right,
+                     _style->getBorderWidth());
   } else {
     XUnmapWindow(otk::OBDisplay::display, _handle);
     XUnmapWindow(otk::OBDisplay::display, _grip_left);
index 757a6984235e328672863e66a7d74e2e8f93126a..ee2fffb52be6bcaabcb3834d5b3a9d53bf92a041 100644 (file)
@@ -54,13 +54,13 @@ void Openbox::signalHandler(int signal)
   case SIGINT:
   case SIGTERM:
   case SIGPIPE:
-    printf("Caught signal %d. Exiting.", signal);
+    printf("Caught signal %d. Exiting.\n", signal);
     instance->shutdown();
 
     break;
   case SIGFPE:
   case SIGSEGV:
-    printf("Caught signal %d. Aborting and dumping core.", signal);
+    printf("Caught signal %d. Aborting and dumping core.\n", signal);
     abort();
   }
 }
@@ -107,10 +107,8 @@ Openbox::~Openbox()
   _state = State_Exiting; // time to kill everything
 
   // unmanage all windows
-  ClientMap::iterator it, end;
-  for (it = _clients.begin(), end = _clients.end(); it != end; ++it) {
-    _xeventhandler.unmanageWindow(it->second);
-  }
+  while (!_clients.empty())
+    _xeventhandler.unmanageWindow(_clients.begin()->second);
   
   // close the X display
   otk::OBDisplay::destroy();
@@ -224,13 +222,24 @@ void Openbox::addClient(Window window, OBClient *client)
 
 void Openbox::removeClient(Window window)
 {
-  _clients[window] = (OBClient *) 0;
+  ClientMap::iterator it = _clients.find(window);
+  if (it != _clients.end())
+    _clients.erase(it);
 }
 
 
 OBClient *Openbox::findClient(Window window)
 {
-  return _clients[window];
+  /*
+    NOTE: we dont use _clients[] to find the value because that will insert
+    a new null into the hash, which really sucks when we want to clean up the
+    hash at shutdown!
+  */
+  ClientMap::iterator it = _clients.find(window);
+  if (it != _clients.end())
+    return it->second;
+  else
+    return (OBClient*) 0;
 }
 
 }
This page took 0.023987 seconds and 4 git commands to generate.