*** window.c.orig Tue Aug 22 11:02:07 2000 --- window.c Tue Aug 22 15:24:15 2000 *************** *** 594,599 **** --- 594,602 ---- Window *biggest = (Window *) 0, *tmp; + if (screen == NULL) + panic("Cannot add window [%d] to NULL screen.", new_w->refnum); + screen->visible_windows++; new_w->screen = screen; new_w->visible = 1; *************** *** 1475,1483 **** if (!window->screen) { remove_from_invisible_list(window); ! if ((window == current_window) && !current_window->screen) window->screen = last_input_screen; /* What the hey */ ! if (!add_to_window_list(current_window->screen, window)) { /* Ooops. this is an error. ;-) */ add_to_invisible_list(window); --- 1478,1486 ---- if (!window->screen) { remove_from_invisible_list(window); ! if (!(window->screen = current_window->screen)) window->screen = last_input_screen; /* What the hey */ ! if (!add_to_window_list(window->screen, window)) { /* Ooops. this is an error. ;-) */ add_to_invisible_list(window); *************** *** 3754,3762 **** return NULL; } - make_window_current(tmp); if (tmp->visible) set_screens_current_window(tmp->screen, tmp); else swap_window(window, tmp); --- 3757,3767 ---- return NULL; } if (tmp->visible) + { + make_window_current(tmp); set_screens_current_window(tmp->screen, tmp); + } else swap_window(window, tmp);