terminal: ignore input without valid GUI mode

This prevents the potential corner case where the terminal receives input
at a time when the window has no valid size and _text_screen_surface is
not constructed.
This commit is contained in:
Norman Feske 2024-11-26 15:40:49 +01:00
parent 4730312c1e
commit d5f3cc6ec2

View File

@ -364,6 +364,9 @@ void Terminal::Main::_handle_config()
void Terminal::Main::_handle_input()
{
if (!_text_screen_surface.constructed())
return;
_gui.input.for_each_event([&] (Input::Event const &event) {
event.handle_absolute_motion([&] (int x, int y) {
@ -485,7 +488,7 @@ void Terminal::Main::_handle_input()
void Terminal::Main::_report_clipboard_selection()
{
if (!_clipboard_reporter.constructed())
if (!_text_screen_surface.constructed() || !_clipboard_reporter.constructed())
return;
_clipboard_reporter->generate([&] (Xml_generator &xml) {