fix: Dropping files onto ImHex opening them twice
This commit is contained in:
parent
52fda5aeb7
commit
3e5967c5a7
@ -86,6 +86,13 @@ namespace hex {
|
||||
RequestChangeTheme::post(hex::containsIgnoreCase(result, "uint32 1") ? "Light" : "Dark");
|
||||
});
|
||||
|
||||
// Register file drop callback
|
||||
glfwSetDropCallback(m_window, [](GLFWwindow *, int count, const char **paths) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
EventFileDropped::post(reinterpret_cast<const char8_t *>(paths[i]));
|
||||
}
|
||||
});
|
||||
|
||||
if (themeFollowSystem)
|
||||
EventOSThemeChanged::post();
|
||||
}
|
||||
|
@ -52,6 +52,13 @@ namespace hex {
|
||||
if (themeFollowSystem)
|
||||
EventOSThemeChanged::post();
|
||||
|
||||
// Register file drop callback
|
||||
glfwSetDropCallback(m_window, [](GLFWwindow *, int count, const char **paths) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
EventFileDropped::post(reinterpret_cast<const char8_t *>(paths[i]));
|
||||
}
|
||||
});
|
||||
|
||||
setupMacosWindowStyle(m_window);
|
||||
}
|
||||
|
||||
|
@ -71,6 +71,13 @@ namespace hex {
|
||||
RequestChangeTheme::post(!isDarkModeEnabled() ? "Light" : "Dark");
|
||||
});
|
||||
|
||||
// Register file drop callback
|
||||
glfwSetDropCallback(m_window, [](GLFWwindow *, int count, const char **paths) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
EventFileDropped::post(reinterpret_cast<const char8_t *>(paths[i]));
|
||||
}
|
||||
});
|
||||
|
||||
if (themeFollowSystem)
|
||||
EventOSThemeChanged::post();
|
||||
}
|
||||
|
@ -1131,13 +1131,6 @@ namespace hex {
|
||||
EventWindowClosing::post(window);
|
||||
});
|
||||
|
||||
// Register file drop callback
|
||||
glfwSetDropCallback(m_window, [](GLFWwindow *, int count, const char **paths) {
|
||||
for (int i = 0; i < count; i++) {
|
||||
EventFileDropped::post(reinterpret_cast<const char8_t *>(paths[i]));
|
||||
}
|
||||
});
|
||||
|
||||
glfwSetWindowSizeLimits(m_window, 480_scaled, 360_scaled, GLFW_DONT_CARE, GLFW_DONT_CARE);
|
||||
|
||||
glfwShowWindow(m_window);
|
||||
|
Loading…
x
Reference in New Issue
Block a user