From 313f6b8b60eff2c9c56546efcb458e19cf5a251d Mon Sep 17 00:00:00 2001 From: Leroy Hopson Date: Fri, 25 Sep 2020 10:06:46 +0700 Subject: [PATCH] Ensure terminal is initialized to the correct size Moves the call to update_size() from _init() to _ready() to ensure Terminal is initialized to the correct size. Former-commit-id: 66b061bf8b1be36f601f977d6bd8005f5d2fc826 --- addons/godot_xterm/native/src/terminal.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/addons/godot_xterm/native/src/terminal.cpp b/addons/godot_xterm/native/src/terminal.cpp index e41b7d8..e9d33da 100644 --- a/addons/godot_xterm/native/src/terminal.cpp +++ b/addons/godot_xterm/native/src/terminal.cpp @@ -305,12 +305,11 @@ void Terminal::_init() { ERR_PRINT("Error setting palette"); } - - update_size(); } void Terminal::_ready() { + update_size(); connect("resized", this, "update_size"); } @@ -319,7 +318,6 @@ void Terminal::_notification(int what) switch (what) { case NOTIFICATION_RESIZED: - Godot::print("resized!"); update_size(); break; } @@ -555,6 +553,7 @@ void Terminal::update_size() tsm_screen_resize(screen, cols, rows); sleep = false; + framebuffer_age = tsm_screen_draw(screen, text_draw_cb, this); update(); }