Only redraw clients after handling all available events

This commit is contained in:
Maxime Coste 2013-09-17 18:51:14 +01:00
parent 7fef7ec063
commit e70d75d6a6
4 changed files with 4 additions and 4 deletions

View File

@ -62,9 +62,7 @@ Client* ClientManager::create_client(std::unique_ptr<UserInterface>&& ui,
{
ClientManager::instance().remove_client(*client);
}
ClientManager::instance().redraw_clients();
});
redraw_clients();
return client;
}

View File

@ -62,7 +62,6 @@ Buffer* open_fifo(const String& name , const String& filename, Context& context)
ssize_t count = read(watcher.fd(), data, buffer_size);
buffer->insert(buffer->end()-1, count > 0 ? String(data, data+count)
: "*** kak: fifo closed ***\n");
ClientManager::instance().redraw_clients();
if (count <= 0)
{
kak_assert(buffer->flags() & Buffer::Flags::Fifo);

View File

@ -1,4 +1,5 @@
#include "event_manager.hh"
#include "client_manager.hh"
#include <poll.h>
@ -73,6 +74,9 @@ void EventManager::handle_next_events()
if (timer->next_date() <= now)
timer->run();
}
if (ClientManager::has_instance())
ClientManager::instance().redraw_clients();
}
void EventManager::force_signal(int fd)

View File

@ -484,7 +484,6 @@ private:
write_debug("error running command '" + m_buffer + "' : " + e.what());
}
catch (client_removed&) {}
ClientManager::instance().redraw_clients();
close(socket);
delete this;
return;