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().remove_client(*client);
} }
ClientManager::instance().redraw_clients();
}); });
redraw_clients();
return client; 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); ssize_t count = read(watcher.fd(), data, buffer_size);
buffer->insert(buffer->end()-1, count > 0 ? String(data, data+count) buffer->insert(buffer->end()-1, count > 0 ? String(data, data+count)
: "*** kak: fifo closed ***\n"); : "*** kak: fifo closed ***\n");
ClientManager::instance().redraw_clients();
if (count <= 0) if (count <= 0)
{ {
kak_assert(buffer->flags() & Buffer::Flags::Fifo); kak_assert(buffer->flags() & Buffer::Flags::Fifo);

View File

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

View File

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