]> Dogcows Code - chaz/openbox/commitdiff
remove the block on shutdown
authorDana Jansens <danakj@orodu.net>
Fri, 3 Jan 2003 20:10:25 +0000 (20:10 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 3 Jan 2003 20:10:25 +0000 (20:10 +0000)
otk/display.cc
src/client.cc
src/openbox.cc
src/screen.cc

index f45dd49bddbf5615c6d1d69089d75d2bfd0a37f1..bd6d2d05d1b31e0ba3cadfa4e217de3713b3b55b 100644 (file)
@@ -162,6 +162,8 @@ line argument.\n\n"));
 void OBDisplay::destroy()
 {
   delete _gccache;
+  while (_grab_count > 0)
+    ungrab();
   XCloseDisplay(display);
 }
 
index 2dec38555ca778a9c081e878c35a2d2bc2a40530..b5bec898b77cfe4d8578a5d9f6a3690c179ec4b3 100644 (file)
@@ -7,7 +7,6 @@
 #include "client.hh"
 #include "frame.hh"
 #include "screen.hh"
-#include "bbscreen.hh"
 #include "openbox.hh"
 #include "otk/display.hh"
 #include "otk/property.hh"
index 9761b46899abaab3f7fa034ad2fa850d1d6f967c..71eb4d9b3aefc801a5df940b9cc737af6b741778 100644 (file)
@@ -172,9 +172,6 @@ Openbox::~Openbox()
 {
   _state = State_Exiting; // time to kill everything
 
-  // return input focus to the root
-  XSetInputFocus(otk::OBDisplay::display, PointerRoot, None, CurrentTime);
-  
   std::for_each(_screens.begin(), _screens.end(), otk::PointerAssassin());
 
   delete _bindings;
@@ -183,11 +180,14 @@ Openbox::~Openbox()
 
   python_destroy();
 
-  XSync(otk::OBDisplay::display, False);
-  
-  // close the X display
-  otk::OBDisplay::destroy();
-  printf("Exiting!\n");
+  XSetInputFocus(otk::OBDisplay::display, PointerRoot, RevertToNone,
+                 CurrentTime);
+  XSync(otk::OBDisplay::display, false);
+
+  // this tends to block.. i honestly am not sure why. causing an x error in
+  // the shutdown process unblocks it. blackbox simply did a ::exit(0), so
+  // all im gunna do is the same.
+  //otk::OBDisplay::destroy();
 }
 
 
index 419ba0b96c0a5369bcedc2fe69733990516915b9..6a9473e418f7561be50d744125fe4b3d6874383b 100644 (file)
@@ -123,14 +123,13 @@ OBScreen::~OBScreen()
   if (! _managed) return;
 
   XSelectInput(otk::OBDisplay::display, _info->rootWindow(), NoEventMask);
-  XSync(otk::OBDisplay::display, False);
   
-  XDestroyWindow(otk::OBDisplay::display, _focuswindow);
-
   // unmanage all windows
   while (!clients.empty())
     unmanageWindow(clients.front());
 
+  XDestroyWindow(otk::OBDisplay::display, _focuswindow);
+
   delete _image_control;
 }
 
@@ -425,7 +424,17 @@ void OBScreen::unmanageWindow(OBClient *client)
 
   Openbox::instance->bindings()->grabButtons(false, client);
 
-  // XXX: pass around focus if this window was focused
+  // remove from the stacking order
+  _stacking.remove(client);
+  
+  // pass around focus if this window was focused XXX do this better!
+  if (Openbox::instance->focusedClient() == client) {
+    OBClient *newfocus = 0;
+    if (!_stacking.empty())
+      newfocus = _stacking.front();
+    if (! (newfocus && newfocus->focus()))
+      client->unfocus();
+  }
 
   // remove from the wm's map
   Openbox::instance->removeClient(client->window());
@@ -457,8 +466,7 @@ void OBScreen::unmanageWindow(OBClient *client)
   delete client->frame;
   client->frame = 0;
 
-  // remove from the screen's lists
-  _stacking.remove(client);
+  // remove from the screen's list
   clients.remove(client);
   delete client;
 
This page took 0.028792 seconds and 4 git commands to generate.