]> Dogcows Code - chaz/openbox/commitdiff
watch for when screens cant be managed
authorDana Jansens <danakj@orodu.net>
Mon, 11 Nov 2002 10:41:44 +0000 (10:41 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 11 Nov 2002 10:41:44 +0000 (10:41 +0000)
src/frame.cc
src/openbox.cc
src/screen.cc
src/screen.hh

index 388dcea64a8451aa5f30955a851bee389e6cfdfd..1fed17684e92b7449bbbb8262b8056f17149cd80 100644 (file)
@@ -412,6 +412,8 @@ void OBFrame::grabClient()
   XUngrabServer(otk::OBDisplay::display);
 
   update();
+
+  XMapWindow(otk::OBDisplay::display, _window);
 }
 
 
index 5e0bff0cb67b2a61ef2e777d6fc40e98c9914ba1..93570c8cf9e37f59ff80c9ced4aca55ed1318538 100644 (file)
@@ -128,9 +128,19 @@ Openbox::Openbox(int argc, char **argv)
   _cursors.ur_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ur_angle);
 
   // initialize all the screens
-  _screens.push_back(new OBScreen(0, _config));
-  _screens[0]->manageExisting();
-  // XXX: "change to" the first workspace on the screen to initialize stuff
+  OBScreen *screen;
+  screen = new OBScreen(0, _config);
+  if (screen->managed()) {
+    _screens.push_back(screen);
+    _screens[0]->manageExisting();
+    // XXX: "change to" the first workspace on the screen to initialize stuff
+  } else
+    delete screen;
+
+  if (_screens.empty()) {
+    printf(_("No screens were found without a window manager. Exiting.\n"));
+    ::exit(1);
+  }
   
   _state = State_Normal; // done starting
 }
index 2da8c77a11e4407fa92116aa1c418329cbb1ee0f..9d316ce4852f1f31d867341a3ad4e27e4dce1a9e 100644 (file)
@@ -327,8 +327,6 @@ void OBScreen::manageWindow(Window window)
   XWMHints *wmhint;
   XSetWindowAttributes attrib_set;
 
-  printf("Managing Window: %lx\n", window);
-
   // is the window a docking app
   if ((wmhint = XGetWMHints(otk::OBDisplay::display, window))) {
     if ((wmhint->flags & StateHint) &&
index 91295f32e86d0a3913565ace0fd3e78ba3632396..516632ac265f768fa70ca2f96f564a18cf28a54c 100644 (file)
@@ -99,6 +99,12 @@ public:
   //! Destroys the OBScreen object
   virtual ~OBScreen();
 
+  //! Returns if the screen was successfully managed
+  /*!
+    If this is false, then the screen should be deleted and should NOT be
+    used.
+  */
+  inline bool managed() const { return _managed; }
   //! Returns the Image Control used for rendering on the screen
   inline otk::BImageControl *imageControl() { return _image_control; }
   //! Returns the dimentions of the screen
This page took 0.031592 seconds and 4 git commands to generate.