summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-02-20 16:57:31 +0100
committerAndreas Kling <kling@serenityos.org>2021-02-20 17:04:46 +0100
commit8c9ae4e537481873a9ecc7d513ae29ac97a67ae7 (patch)
tree7432ecf19f7472e39c7802155de250ab4e4483d9 /Userland/Libraries
parentbb6d6dce7b4e39c8fdea8689650bf6fb8ad30f92 (diff)
downloadserenity-8c9ae4e537481873a9ecc7d513ae29ac97a67ae7.zip
Terminal+LibVT: Resize Terminal app window when requested by VT
This will allow us to react to things like DECCOLM.
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.cpp3
-rw-r--r--Userland/Libraries/LibVT/TerminalWidget.h1
2 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibVT/TerminalWidget.cpp b/Userland/Libraries/LibVT/TerminalWidget.cpp
index c38a0f7600..0cda393bf4 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.cpp
+++ b/Userland/Libraries/LibVT/TerminalWidget.cpp
@@ -954,6 +954,9 @@ void TerminalWidget::terminal_did_resize(u16 columns, u16 rows)
m_pixel_width = pixel_size.width();
m_pixel_height = pixel_size.height();
+ if (on_terminal_size_change)
+ on_terminal_size_change(Gfx::IntSize { m_pixel_width, m_pixel_height });
+
if (m_automatic_size_policy) {
set_fixed_size(m_pixel_width, m_pixel_height);
}
diff --git a/Userland/Libraries/LibVT/TerminalWidget.h b/Userland/Libraries/LibVT/TerminalWidget.h
index 49d76ca4b4..5550de3fe1 100644
--- a/Userland/Libraries/LibVT/TerminalWidget.h
+++ b/Userland/Libraries/LibVT/TerminalWidget.h
@@ -101,6 +101,7 @@ public:
void clear_including_history();
Function<void(const StringView&)> on_title_change;
+ Function<void(const Gfx::IntSize&)> on_terminal_size_change;
Function<void()> on_command_exit;
GUI::Menu& context_menu() { return *m_context_menu; }