fix segfaut from uninitialized focused_screen pointer

This commit is contained in:
Dana Jansens 2002-05-13 23:09:20 +00:00
parent abfaee7368
commit d6c02ad70c
5 changed files with 11 additions and 6 deletions

View file

@ -1,7 +1,12 @@
Changelog for Openbox: Changelog for Openbox:
1.2.0: 1.2.0:
* make image dithering value load correctly * more focus code changes. also fixes a segfault from
last round of focus changes. (Ben Jansens)
* make image dithering value load correctly. (Ben Jansens)
* fix segfault with multiple screens. (Shaleh Perry)
1.1.0: 1.1.0:
* improved focused window logic to remove a segfault * improved focused window logic to remove a segfault

View file

@ -519,7 +519,6 @@ void BaseDisplay::ungrab(void) {
void BaseDisplay::addTimer(BTimer *timer) { void BaseDisplay::addTimer(BTimer *timer) {
ASSERT(timer != (BTimer *) 0); ASSERT(timer != (BTimer *) 0);
printf("ADDING TIMER\n");
TimerList::iterator it; TimerList::iterator it;
for (it = timerList.begin(); it != timerList.end(); ++it) { for (it = timerList.begin(); it != timerList.end(); ++it) {
@ -535,7 +534,6 @@ void BaseDisplay::addTimer(BTimer *timer) {
void BaseDisplay::removeTimer(BTimer *timer) { void BaseDisplay::removeTimer(BTimer *timer) {
printf("REMOVING TIMER\n");
timerList.remove(timer); timerList.remove(timer);
} }

View file

@ -225,6 +225,7 @@ BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn),
slit = NULL; slit = NULL;
#endif // SLIT #endif // SLIT
toolbar = NULL; toolbar = NULL;
current_workspace = (Workspace *) 0;
#ifdef HAVE_GETPID #ifdef HAVE_GETPID
pid_t bpid = getpid(); pid_t bpid = getpid();

View file

@ -725,7 +725,9 @@ void Toolbar::checkClock(Bool redraw, Bool date) {
void Toolbar::redrawWindowLabel(Bool redraw) { void Toolbar::redrawWindowLabel(Bool redraw) {
OpenboxWindow *foc = screen.getOpenbox().focusedWindow(); OpenboxWindow *foc = screen.getOpenbox().focusedWindow();
if (foc != (OpenboxWindow *) 0) { if (foc == (OpenboxWindow *) 0) {
XClearWindow(display, frame.window_label);
} else {
if (redraw) if (redraw)
XClearWindow(display, frame.window_label); XClearWindow(display, frame.window_label);
@ -780,8 +782,6 @@ void Toolbar::redrawWindowLabel(Bool redraw) {
else else
XDrawString(display, frame.window_label, style->w_text_gc, dx, XDrawString(display, frame.window_label, style->w_text_gc, dx,
(style->font->ascent + 1), *foc->getTitle(), dlen); (style->font->ascent + 1), *foc->getTitle(), dlen);
} else {
XClearWindow(display, frame.window_label);
} }
} }

View file

@ -186,6 +186,7 @@ Openbox::Openbox(int m_argc, char **m_argv, char *dpy_name, char *rc)
resource.titlebar_layout = NULL; resource.titlebar_layout = NULL;
resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0; resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0;
focused_screen = (BScreen *) 0;
masked_window = NULL; masked_window = NULL;
masked = None; masked = None;