From ba421e45f7b97c5e7ba28efe4f148fb3ba87a22c Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Fri, 13 May 2016 20:32:53 +0100 Subject: Delay window deletion until we get back to main loop Avoid WinResize hooks while redrawing, ensure window resize only take place while handling user input. Fixes #672 --- src/client_manager.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/client_manager.cc') diff --git a/src/client_manager.cc b/src/client_manager.cc index aff88d93..96165538 100644 --- a/src/client_manager.cc +++ b/src/client_manager.cc @@ -143,9 +143,18 @@ void ClientManager::ensure_no_client_uses_buffer(Buffer& buffer) auto end = std::remove_if(m_free_windows.begin(), m_free_windows.end(), [&buffer](const WindowAndSelections& ws) { return &ws.window->buffer() == &buffer; }); + + for (auto it = end; it != m_free_windows.end(); ++it) + m_window_trash.push_back(std::move(it->window)); + m_free_windows.erase(end, m_free_windows.end()); } +void ClientManager::clear_window_trash() +{ + m_window_trash.clear(); +} + bool ClientManager::validate_client_name(StringView name) const { return const_cast(this)->get_client_ifp(name) == nullptr; -- cgit v1.2.3