watch for when screens cant be managed
This commit is contained in:
parent
e503323dcf
commit
24dd636f73
4 changed files with 21 additions and 5 deletions
|
@ -412,6 +412,8 @@ void OBFrame::grabClient()
|
||||||
XUngrabServer(otk::OBDisplay::display);
|
XUngrabServer(otk::OBDisplay::display);
|
||||||
|
|
||||||
update();
|
update();
|
||||||
|
|
||||||
|
XMapWindow(otk::OBDisplay::display, _window);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -128,9 +128,19 @@ Openbox::Openbox(int argc, char **argv)
|
||||||
_cursors.ur_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ur_angle);
|
_cursors.ur_angle = XCreateFontCursor(otk::OBDisplay::display, XC_ur_angle);
|
||||||
|
|
||||||
// initialize all the screens
|
// initialize all the screens
|
||||||
_screens.push_back(new OBScreen(0, _config));
|
OBScreen *screen;
|
||||||
_screens[0]->manageExisting();
|
screen = new OBScreen(0, _config);
|
||||||
// XXX: "change to" the first workspace on the screen to initialize stuff
|
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
|
_state = State_Normal; // done starting
|
||||||
}
|
}
|
||||||
|
|
|
@ -327,8 +327,6 @@ void OBScreen::manageWindow(Window window)
|
||||||
XWMHints *wmhint;
|
XWMHints *wmhint;
|
||||||
XSetWindowAttributes attrib_set;
|
XSetWindowAttributes attrib_set;
|
||||||
|
|
||||||
printf("Managing Window: %lx\n", window);
|
|
||||||
|
|
||||||
// is the window a docking app
|
// is the window a docking app
|
||||||
if ((wmhint = XGetWMHints(otk::OBDisplay::display, window))) {
|
if ((wmhint = XGetWMHints(otk::OBDisplay::display, window))) {
|
||||||
if ((wmhint->flags & StateHint) &&
|
if ((wmhint->flags & StateHint) &&
|
||||||
|
|
|
@ -99,6 +99,12 @@ public:
|
||||||
//! Destroys the OBScreen object
|
//! Destroys the OBScreen object
|
||||||
virtual ~OBScreen();
|
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
|
//! Returns the Image Control used for rendering on the screen
|
||||||
inline otk::BImageControl *imageControl() { return _image_control; }
|
inline otk::BImageControl *imageControl() { return _image_control; }
|
||||||
//! Returns the dimentions of the screen
|
//! Returns the dimentions of the screen
|
||||||
|
|
Loading…
Reference in a new issue