Skip to content

Commit

Permalink
Fixed monitor size arguments not changing window size (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
MCJack123 committed Aug 29, 2024
1 parent a85db2b commit 0c78354
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/peripheral/monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,18 @@ monitor::monitor(lua_State *L, const char * side) {
unsigned w = term->width, h = term->height;
if (lua_isnumber(L, 3)) w = (unsigned)lua_tointeger(L, 3);
if (lua_isnumber(L, 4)) h = (unsigned)lua_tointeger(L, 4);
if (w != term->width || h != term->height) term->resize(w, h);
if (w != term->width || h != term->height) {
SDLTerminal * sdlterm = dynamic_cast<SDLTerminal*>(term);
if (sdlterm) sdlterm->resizeWholeWindow(w, h);
else term->resize(w, h);
}
}

monitor::~monitor() {term->factory->deleteTerminal(term);}

int monitor::write(lua_State *L) {
lastCFunction = __func__;
if (selectedRenderer == 4) printf("TW:%d;%s\n", term->id, luaL_checkstring(L, 1));
if (selectedRenderer == 4) printf("TW:%d;%s\n", term->id, luaL_checkstring(L, 1));
size_t str_sz;
const char * str = luaL_checklstring(L, 1, &str_sz);
std::lock_guard<std::mutex> lock(term->locked);
Expand Down

0 comments on commit 0c78354

Please sign in to comment.