From 6f11873d7ed63238a3b1302ddc194743513fa162 Mon Sep 17 00:00:00 2001 From: Integral Date: Sun, 21 Apr 2024 03:24:20 -0700 Subject: [PATCH] fix: Missing window icon under wayland (#1633) ### Problem description When running ImHex under Wayland, the window icon is missing. ### Implementation description Setting [```GLFW_WAYLAND_APP_ID```](https://www.glfw.org/docs/latest/group__window.html#gafbf1ce7a4362c75e602a4df9e1bdecd3) to fix the issue. ### Screenshots Before: ![Screenshot_20240420_162144](https://github.com/WerWolv/ImHex/assets/71180087/3318970f-6ed7-4161-b686-c2eaa28a0739) After: ![Screenshot_20240420_161920](https://github.com/WerWolv/ImHex/assets/71180087/e9e35fb6-e3c1-44a8-b7a5-b145dfe225d9) ### Additional things --- main/gui/source/init/splash_window.cpp | 4 ++++ main/gui/source/window/window.cpp | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/main/gui/source/init/splash_window.cpp b/main/gui/source/init/splash_window.cpp index b1741aef4..5b3265d18 100644 --- a/main/gui/source/init/splash_window.cpp +++ b/main/gui/source/init/splash_window.cpp @@ -415,6 +415,10 @@ namespace hex::init { glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); #endif + #if defined(OS_LINUX) + glfwWindowHintString(GLFW_WAYLAND_APP_ID, "imhex"); + #endif + // Make splash screen non-resizable, undecorated and transparent glfwWindowHint(GLFW_RESIZABLE, GLFW_FALSE); glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GLFW_TRUE); diff --git a/main/gui/source/window/window.cpp b/main/gui/source/window/window.cpp index 0bb278405..b0cebbe5d 100644 --- a/main/gui/source/window/window.cpp +++ b/main/gui/source/window/window.cpp @@ -720,6 +720,10 @@ namespace hex { glfwWindowHint(GLFW_DECORATED, ImHexApi::System::isBorderlessWindowModeEnabled() ? GL_FALSE : GL_TRUE); #endif + #if defined(OS_LINUX) + glfwWindowHintString(GLFW_WAYLAND_APP_ID, "imhex"); + #endif + glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE); glfwWindowHint(GLFW_TRANSPARENT_FRAMEBUFFER, GLFW_TRUE); glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE);