Skip to content

Commit

Permalink
fix: Properly detect Windows 10
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Jan 20, 2025
1 parent 3a888d4 commit 242b100
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
4 changes: 2 additions & 2 deletions main/gui/source/window/win_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include <fcntl.h>
#include <shellapi.h>
#include <timeapi.h>
#include <VersionHelpers.h>

namespace hex {

Expand Down Expand Up @@ -389,8 +390,7 @@ namespace hex {

// Windows versions before Windows 10 have issues with transparent framebuffers
// causing the entire window to be slightly transparent ignoring all configurations
OSVERSIONINFOA versionInfo = { };
if (::GetVersionExA(&versionInfo) && versionInfo.dwMajorVersion >= 10) {
if (::IsWindows10OrGreater()) {
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);
} else {
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_FALSE);
Expand Down
1 change: 0 additions & 1 deletion main/gui/source/window/window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,7 +924,6 @@ namespace hex {
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);
glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE);

if (initialWindowProperties.has_value()) {
glfwWindowHint(GLFW_MAXIMIZED, initialWindowProperties->maximized);
Expand Down
10 changes: 9 additions & 1 deletion resources/dist/windows/imhex.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,12 @@
<consoleAllocationPolicy xmlns="http://schemas.microsoft.com/SMI/2024/WindowsSettings">detached</consoleAllocationPolicy>
</windowsSettings>
</application>
</assembly>

<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10, version 1903 -->
<maxversiontested Id="10.0.18362.1"/>
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}" />
</application>
</compatibility>
</assembly>

0 comments on commit 242b100

Please sign in to comment.