fix: Window title being cleared after ImHex exits
This commit is contained in:
parent
0e8273eaa7
commit
73d4214fd3
@ -13,15 +13,15 @@
|
|||||||
|
|
||||||
#include <wolv/types/type_name.hpp>
|
#include <wolv/types/type_name.hpp>
|
||||||
|
|
||||||
#define EVENT_DEF_IMPL(event_name, should_log, ...) \
|
#define EVENT_DEF_IMPL(event_name, event_name_string, should_log, ...) \
|
||||||
struct event_name final : public hex::impl::Event<__VA_ARGS__> { \
|
struct event_name final : public hex::impl::Event<__VA_ARGS__> { \
|
||||||
constexpr static auto Id = [] { return hex::impl::EventId(); }(); \
|
constexpr static auto Id = [] { return hex::impl::EventId(event_name_string); }(); \
|
||||||
constexpr static auto ShouldLog = (should_log); \
|
constexpr static auto ShouldLog = (should_log); \
|
||||||
explicit event_name(Callback func) noexcept : Event(std::move(func)) { } \
|
explicit event_name(Callback func) noexcept : Event(std::move(func)) { } \
|
||||||
}
|
}
|
||||||
|
|
||||||
#define EVENT_DEF(event_name, ...) EVENT_DEF_IMPL(event_name, true, __VA_ARGS__)
|
#define EVENT_DEF(event_name, ...) EVENT_DEF_IMPL(event_name, #event_name, true, __VA_ARGS__)
|
||||||
#define EVENT_DEF_NO_LOG(event_name, ...) EVENT_DEF_IMPL(event_name, false, __VA_ARGS__)
|
#define EVENT_DEF_NO_LOG(event_name, ...) EVENT_DEF_IMPL(event_name, #event_name, false, __VA_ARGS__)
|
||||||
|
|
||||||
struct GLFWwindow;
|
struct GLFWwindow;
|
||||||
|
|
||||||
@ -31,9 +31,9 @@ namespace hex {
|
|||||||
|
|
||||||
class EventId {
|
class EventId {
|
||||||
public:
|
public:
|
||||||
explicit constexpr EventId(const char *func = __builtin_FUNCTION(), u32 line = __builtin_LINE()) {
|
explicit constexpr EventId(const char *eventName) {
|
||||||
this->m_hash = line ^ 987654321;
|
this->m_hash = 0x811C'9DC5;
|
||||||
for (auto c : std::string_view(func)) {
|
for (auto c : std::string_view(eventName)) {
|
||||||
this->m_hash = (this->m_hash >> 5) | (this->m_hash << 27);
|
this->m_hash = (this->m_hash >> 5) | (this->m_hash << 27);
|
||||||
this->m_hash ^= c;
|
this->m_hash ^= c;
|
||||||
}
|
}
|
||||||
|
@ -227,7 +227,7 @@ namespace hex::init {
|
|||||||
cfg.MergeMode = true;
|
cfg.MergeMode = true;
|
||||||
|
|
||||||
// Add font awesome and codicons icons to font atlas
|
// Add font awesome and codicons icons to font atlas
|
||||||
cfg.GlyphOffset = ImVec2(0, 3);
|
cfg.GlyphOffset = ImVec2(0, 3_scaled);
|
||||||
fonts->AddFontFromMemoryCompressedTTF(font_awesome_compressed_data, font_awesome_compressed_size, 0, &cfg, fontAwesomeRange);
|
fonts->AddFontFromMemoryCompressedTTF(font_awesome_compressed_data, font_awesome_compressed_size, 0, &cfg, fontAwesomeRange);
|
||||||
fonts->AddFontFromMemoryCompressedTTF(codicons_compressed_data, codicons_compressed_size, 0, &cfg, codiconsRange);
|
fonts->AddFontFromMemoryCompressedTTF(codicons_compressed_data, codicons_compressed_size, 0, &cfg, codiconsRange);
|
||||||
|
|
||||||
@ -276,6 +276,8 @@ namespace hex::init {
|
|||||||
|
|
||||||
EventManager::post<EventImHexClosing>();
|
EventManager::post<EventImHexClosing>();
|
||||||
|
|
||||||
|
EventManager::clear();
|
||||||
|
|
||||||
while (ImHexApi::Provider::isValid())
|
while (ImHexApi::Provider::isValid())
|
||||||
ImHexApi::Provider::remove(ImHexApi::Provider::get());
|
ImHexApi::Provider::remove(ImHexApi::Provider::get());
|
||||||
ContentRegistry::Provider::impl::getEntries().clear();
|
ContentRegistry::Provider::impl::getEntries().clear();
|
||||||
@ -348,8 +350,6 @@ namespace hex::init {
|
|||||||
|
|
||||||
fs::setFileBrowserErrorCallback(nullptr);
|
fs::setFileBrowserErrorCallback(nullptr);
|
||||||
|
|
||||||
EventManager::clear();
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user