diff options
-rw-r--r-- | xP/public/xP.js | 5 | ||||
-rw-r--r-- | xW/xW.cpp | 8 |
2 files changed, 11 insertions, 2 deletions
diff --git a/xP/public/xP.js b/xP/public/xP.js index 5dd578d..e4f5647 100644 --- a/xP/public/xP.js +++ b/xP/public/xP.js @@ -344,6 +344,11 @@ rpcEventHandlers.set(Relay.Event.BufferStats, e => { rpcEventHandlers.set(Relay.Event.BufferRename, e => { buffers.set(e.new, buffers.get(e.bufferName)) buffers.delete(e.bufferName) + + if (e.bufferName === bufferCurrent) + bufferCurrent = e.new + if (e.bufferName === bufferLast) + bufferLast = e.new }) rpcEventHandlers.set(Relay.Event.BufferRemove, e => { @@ -914,11 +914,15 @@ relay_process_message(const Relay::EventMessage &m) if (!b) break; - b->buffer_name = data.buffer_name; + b->buffer_name = data.new_; refresh_buffer_list(); - if (b->buffer_name == g.buffer_current) + if (data.buffer_name == g.buffer_current) { + g.buffer_current = data.new_; refresh_status(); + } + if (data.buffer_name == g.buffer_last) + g.buffer_last = data.new_; break; } case Relay::Event::BUFFER_REMOVE: |