summaryrefslogtreecommitdiff
path: root/src/context.cc
diff options
context:
space:
mode:
authorTobias Pisani <topisani@hamsterpoison.com>2024-03-03 04:29:32 +0100
committerTobias Pisani <topisani@hamsterpoison.com>2024-03-27 17:59:05 +0100
commit5515383ae4683c3d691004cbc422ee1f6e36ee07 (patch)
treeb45f864897dd5ac6a3d531f79db1d019870dcf39 /src/context.cc
parent2f7568485ff6ac6aaf83f6ac5988de6a723083c4 (diff)
Add ClientRenamed hook
Diffstat (limited to 'src/context.cc')
-rw-r--r--src/context.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/context.cc b/src/context.cc
index 0c1b8aad..71a5becd 100644
--- a/src/context.cc
+++ b/src/context.cc
@@ -4,6 +4,7 @@
#include "client.hh"
#include "face_registry.hh"
#include "buffer_manager.hh"
+#include "hook_manager.hh"
#include "register_manager.hh"
#include "window.hh"
@@ -417,4 +418,8 @@ StringView Context::main_sel_register_value(StringView reg) const
return RegisterManager::instance()[reg].get_main(*this, index);
}
+void Context::set_name(String name) {
+ String old_name = std::exchange(m_name, std::move(name));
+ hooks().run_hook(Hook::ClientRenamed, format("{}:{}", old_name, m_name), *this);
+}
}