Compare commits

...

10 Commits

Author SHA1 Message Date
WerWolv
8f8131b7c4 build: Install updater binary into bundle on macOS 2025-02-26 20:37:47 +01:00
WerWolv
b6b24dfd29 build: Bumped version to 1.37.4 2025-02-26 19:39:54 +01:00
WerWolv
041f113402 fix: More issues with OpenGL texture deallocation 2025-02-26 18:35:36 +01:00
WerWolv
5f61fe2c4f fix: Only try to delete textures if OpenGL is still available 2025-02-25 21:51:18 +01:00
WerWolv
96cc7e8ba8 fix: Wrong scripts menu rendering on macOS with OS menu bar enabled 2025-02-25 21:51:01 +01:00
WerWolv
22b3daf082 impr: Reduce CPU usage further 2025-02-25 21:50:04 +01:00
WerWolv
1deb27a6df fix: Large CPU usage 2025-02-25 15:58:13 +01:00
WerWolv
73fdc3c6ea build: Bumped version to 1.37.3 2025-02-25 14:54:08 +01:00
WerWolv
cae0f772d5 fix: ID collision when having duplicate fonts installed
Fixes #2141
2025-02-25 12:07:51 +01:00
WerWolv
51547dc941 fix: Crash on exit due to frame rate limiter thread not being shut down
Fixes #2140
2025-02-25 12:07:45 +01:00
6 changed files with 27 additions and 12 deletions

View File

@@ -1 +1 @@
1.37.2
1.37.4

View File

@@ -329,6 +329,7 @@ macro(createPackage)
install(FILES ${IMHEX_ICON} DESTINATION "${CMAKE_INSTALL_PREFIX}/${BUNDLE_NAME}/Contents/Resources")
install(TARGETS main BUNDLE DESTINATION ".")
install(TARGETS updater BUNDLE DESTINATION ".")
# Update library references to make the bundle portable
postprocess_bundle(imhex_all main)

View File

@@ -260,9 +260,6 @@ namespace ImGuiExt {
}
Texture::Texture(Texture&& other) noexcept {
if (m_textureId != 0)
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
m_textureId = other.m_textureId;
m_width = other.m_width;
m_height = other.m_height;
@@ -271,8 +268,10 @@ namespace ImGuiExt {
}
Texture& Texture::operator=(Texture&& other) noexcept {
if (m_textureId != 0)
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
if (this == &other)
return *this;
this->reset();
m_textureId = other.m_textureId;
m_width = other.m_width;
@@ -288,6 +287,11 @@ namespace ImGuiExt {
}
void Texture::reset() {
#if !defined(OS_WEB)
if (glDeleteTextures == nullptr)
return;
#endif
if (m_textureId != 0) {
glDeleteTextures(1, reinterpret_cast<GLuint*>(&m_textureId));
m_textureId = 0;

View File

@@ -100,6 +100,9 @@ namespace hex {
}
Window::~Window() {
m_frameRateThread.request_stop();
m_frameRateThread.join();
EventProviderDeleted::unsubscribe(this);
RequestCloseImHex::unsubscribe(this);
RequestUpdateWindowTitle::unsubscribe(this);
@@ -300,7 +303,7 @@ namespace hex {
{
std::unique_lock lock(m_sleepMutex);
m_sleepCondVar.wait_for(lock, std::chrono::microseconds(100));
m_sleepCondVar.wait(lock);
if (m_sleepFlag.exchange(false))
break;
}
@@ -1230,6 +1233,7 @@ namespace hex {
m_wakeupCondVar.wait_for(lock, requestedFrameTime, [&] {
return m_wakeupFlag || stopToken.stop_requested();
});
m_wakeupFlag = false;
}
endTime = std::chrono::steady_clock::now();

View File

@@ -37,13 +37,18 @@ namespace hex::fonts {
});
}
u32 index = 0;
for (const auto &[path, fontName] : hex::getFonts()) {
ImGui::PushID(index);
if (ImGui::Selectable(limitStringLength(fontName, 50).c_str(), m_path == path)) {
m_path = path;
m_pixelPerfectFont = false;
changed = true;
}
ImGui::SetItemTooltip("%s", fontName.c_str());
ImGui::PopID();
index += 1;
}
ImGui::EndCombo();

View File

@@ -5,6 +5,7 @@
#include <hex/api/localization_manager.hpp>
#include <hex/helpers/logger.hpp>
#include <hex/helpers/menu_items.hpp>
#include <hex/ui/imgui_imhex_extensions.h>
#include <loaders/dotnet/dotnet_loader.hpp>
@@ -88,7 +89,7 @@ std::vector<const Script*> loadAllScripts() {
hex::ContentRegistry::Interface::addMenuItemSubMenu({ "hex.builtin.menu.extras" }, 5000, [] {
static bool menuJustOpened = true;
if (ImGui::BeginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
if (menu::beginMenuEx("hex.script_loader.menu.run_script"_lang, ICON_VS_LIBRARY)) {
if (menuJustOpened) {
menuJustOpened = false;
if (!updaterTask.isRunning()) {
@@ -99,9 +100,9 @@ std::vector<const Script*> loadAllScripts() {
}
if (updaterTask.isRunning()) {
ImGuiExt::TextSpinner("hex.script_loader.menu.loading"_lang);
menu::menuItem("hex.script_loader.menu.loading"_lang, Shortcut::None, false, false);
} else if (scripts.empty()) {
ImGui::TextUnformatted("hex.script_loader.menu.no_scripts"_lang);
menu::menuItem("hex.script_loader.menu.no_scripts"_lang, Shortcut::None, false, false);
}
for (const auto &script : scripts) {
@@ -109,14 +110,14 @@ std::vector<const Script*> loadAllScripts() {
if (background)
continue;
if (ImGui::MenuItem(name.c_str(), loader->getTypeName().c_str())) {
if (menu::menuItem(name.c_str())) {
runnerTask = TaskManager::createTask("hex.script_loader.task.running", TaskManager::NoProgress, [entryPoint](auto&) {
entryPoint();
});
}
}
ImGui::EndMenu();
menu::endMenu();
} else {
menuJustOpened = true;
}