summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2002-11-11 10:41:44 +0000
committerDana Jansens <danakj@orodu.net>2002-11-11 10:41:44 +0000
commit24dd636f7318b0d21637aa7ffe253fe0ebf71f24 (patch)
tree7cc64542881d853c81d06a966669a5246ee36008
parente503323dcf36c7b4c173ddc0cd302b8642361f48 (diff)
watch for when screens cant be managed
-rw-r--r--src/frame.cc2
-rw-r--r--src/openbox.cc16
-rw-r--r--src/screen.cc2
-rw-r--r--src/screen.hh6
4 files changed, 21 insertions, 5 deletions
diff --git a/src/frame.cc b/src/frame.cc
index 388dcea6..1fed1768 100644
--- a/src/frame.cc
+++ b/src/frame.cc
@@ -412,6 +412,8 @@ void OBFrame::grabClient()
XUngrabServer(otk::OBDisplay::display);
update();
+
+ XMapWindow(otk::OBDisplay::display, _window);
}
diff --git a/src/openbox.cc b/src/openbox.cc
index 5e0bff0c..93570c8c 100644
--- a/src/openbox.cc
+++ b/src/openbox.cc
@@ -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
}
diff --git a/src/screen.cc b/src/screen.cc
index 2da8c77a..9d316ce4 100644
--- a/src/screen.cc
+++ b/src/screen.cc
@@ -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) &&
diff --git a/src/screen.hh b/src/screen.hh
index 91295f32..516632ac 100644
--- a/src/screen.hh
+++ b/src/screen.hh
@@ -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