diff --git a/doomsday/engine/portable/src/ui_main.c b/doomsday/engine/portable/src/ui_main.c index 474a09103e..c12677609a 100644 --- a/doomsday/engine/portable/src/ui_main.c +++ b/doomsday/engine/portable/src/ui_main.c @@ -464,11 +464,14 @@ void UI_SetPage(ui_page_t* page) dat->numvis = (ob->geometry.size.height - 2 * UI_BORDER) / listItemHeight(dat); if(dat->selection >= 0) { + // There is a selected item, make sure it is visible. if(dat->selection < dat->first) dat->first = dat->selection; if(dat->selection > dat->first + dat->numvis - 1) dat->first = dat->selection - dat->numvis + 1; } + // Check that the visible range is ok. + dat->first = MIN_OF(dat->first, dat->count - dat->numvis); UI_InitColumns(ob); } } diff --git a/doomsday/engine/portable/src/window.cpp b/doomsday/engine/portable/src/window.cpp index 71084e8d82..64695fc17c 100644 --- a/doomsday/engine/portable/src/window.cpp +++ b/doomsday/engine/portable/src/window.cpp @@ -190,7 +190,6 @@ struct ddwindow_s { geometry.size.width = DisplayMode_Current()->width; geometry.size.height = DisplayMode_Current()->height; - #ifdef MACOSX // Pull the window again over the shield after the mode change. DisplayMode_Native_Raise(Window_NativeHandle(this));