diff --git a/main/gui/source/window/linux_window.cpp b/main/gui/source/window/linux_window.cpp index bc80ebf92..f27535532 100644 --- a/main/gui/source/window/linux_window.cpp +++ b/main/gui/source/window/linux_window.cpp @@ -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(paths[i])); + } + }); + if (themeFollowSystem) EventOSThemeChanged::post(); } diff --git a/main/gui/source/window/macos_window.cpp b/main/gui/source/window/macos_window.cpp index 0b4f9de09..2976d83ba 100644 --- a/main/gui/source/window/macos_window.cpp +++ b/main/gui/source/window/macos_window.cpp @@ -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(paths[i])); + } + }); + setupMacosWindowStyle(m_window); } diff --git a/main/gui/source/window/web_window.cpp b/main/gui/source/window/web_window.cpp index 01ee8ae3e..96e8d6cf2 100644 --- a/main/gui/source/window/web_window.cpp +++ b/main/gui/source/window/web_window.cpp @@ -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(paths[i])); + } + }); + if (themeFollowSystem) EventOSThemeChanged::post(); } diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 4dc32cf39..a7a58c772 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -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(paths[i])); - } - }); - glfwSetWindowSizeLimits(m_window, 480_scaled, 360_scaled, GLFW_DONT_CARE, GLFW_DONT_CARE); glfwShowWindow(m_window);