diff --git a/objects/screen.c b/objects/screen.c index 7b0d0219..62e6479c 100644 --- a/objects/screen.c +++ b/objects/screen.c @@ -661,6 +661,10 @@ screen_refresh(void) screen_deduplicate(L, &new_screens); + /* Running without any screens at all is no fun. */ + if (new_screens.len == 0) + screen_scan_x11(L, &new_screens); + /* Add new screens */ foreach(new_screen, new_screens) { bool found = false; @@ -1176,6 +1180,11 @@ luaA_screen_fake_remove(lua_State *L) /* WTF? */ return 0; + if (globalconf.screens.len == 1) { + luaA_warn(L, "Removing last screen through fake_remove(). " + "This is a very, very, very bad idea!"); + } + screen_array_take(&globalconf.screens, idx); luaA_object_push(L, s); screen_removed(L, -1);