diff --git a/lib/libimhex/include/hex/helpers/utils_macos.hpp b/lib/libimhex/include/hex/helpers/utils_macos.hpp index ed5ba72ba..46f09bc6d 100644 --- a/lib/libimhex/include/hex/helpers/utils_macos.hpp +++ b/lib/libimhex/include/hex/helpers/utils_macos.hpp @@ -2,6 +2,8 @@ #if defined(OS_MACOS) + struct GLFWwindow; + extern "C" { void errorMessageMacos(const char *message); @@ -9,6 +11,8 @@ bool isMacosSystemDarkModeEnabled(); float getBackingScaleFactor(); + void setupMacosWindowStyle(GLFWwindow *window); + } #endif \ No newline at end of file diff --git a/lib/libimhex/source/helpers/utils_macos.m b/lib/libimhex/source/helpers/utils_macos.m index 7f71d2881..f49aa6796 100644 --- a/lib/libimhex/source/helpers/utils_macos.m +++ b/lib/libimhex/source/helpers/utils_macos.m @@ -9,7 +9,11 @@ #include #include #include - + + #define GLFW_EXPOSE_NATIVE_COCOA + #include + #include + #import #import @@ -40,6 +44,11 @@ return [[NSScreen mainScreen] backingScaleFactor]; } + void setupMacosWindowStyle(GLFWwindow *window) { + NSWindow* cocoaWindow = glfwGetCocoaWindow(window); + cocoaWindow.titleVisibility = NSWindowTitleHidden; + } + @interface HexDocument : NSDocument @end diff --git a/main/gui/source/window/macos_window.cpp b/main/gui/source/window/macos_window.cpp index 9b9edebda..0b4f9de09 100644 --- a/main/gui/source/window/macos_window.cpp +++ b/main/gui/source/window/macos_window.cpp @@ -3,13 +3,11 @@ #if defined(OS_MACOS) #include - #include #include #include #include - #include #include #include @@ -53,12 +51,16 @@ namespace hex { if (themeFollowSystem) EventOSThemeChanged::post(); + + setupMacosWindowStyle(m_window); } void Window::beginNativeWindowFrame() { + } void Window::endNativeWindowFrame() { + } } diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 0e275974e..2caae6b63 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -814,9 +814,9 @@ namespace hex { continue; const auto openViewCount = std::ranges::count_if(ContentRegistry::Views::impl::getEntries(), [](const auto &entry) { - const auto &[unlocalizedName, view] = entry; + const auto &[unlocalizedName, openView] = entry; - return view->hasViewMenuItemEntry() && view->shouldProcess(); + return openView->hasViewMenuItemEntry() && openView->shouldProcess(); }); ImGuiWindowClass windowClass = {};