terminal: respond to window-close event

This commit is contained in:
Norman Feske 2018-05-15 12:15:46 +02:00 committed by Christian Helmuth
parent d3626bd84f
commit 78c09c27ca
2 changed files with 4 additions and 4 deletions

View File

@ -83,7 +83,8 @@ class Terminal::Framebuffer
* the old (possibly too small) dataspace.
*/
_mode = _fb.mode();
_ds.construct(_env.rm(), _fb.dataspace());
if (_mode.width() && _mode.height())
_ds.construct(_env.rm(), _fb.dataspace());
}
};

View File

@ -229,9 +229,7 @@ void Terminal::Main::_handle_config()
_text_screen_surface->geometry(new_geometry);
}
}
catch (Text_screen_surface<PT>::Geometry::Invalid)
{
warning("invalid framebuffer size");
catch (Text_screen_surface<PT>::Geometry::Invalid) {
/*
* Make sure to never operate on an invalid-sized framebuffer
@ -240,6 +238,7 @@ void Terminal::Main::_handle_config()
* there may still be a stale '_text_screen_surface'.
*/
_text_screen_surface.destruct();
_terminal_size = Area(0, 0);
}
_root.notify_resized(Session::Size(_terminal_size.w(), _terminal_size.h()));