Files
vpinball-wasm/patches/vpinball/0009-emscripten-skip-window-icon.patch
T

26 lines
1.1 KiB
Diff
Raw Permalink Normal View History

diff --git a/src/renderer/Window.cpp b/src/renderer/Window.cpp
index 3dff060..92a96df 100644
--- a/src/renderer/Window.cpp
+++ b/src/renderer/Window.cpp
@@ -264,6 +264,12 @@ Window::Window(const string& title, const Settings& settings, VPXWindowId window
m_pixelDensity = 1.f;
}
+#ifndef __EMSCRIPTEN__
+ // SDL3's Emscripten video backend emulates SDL_SetWindowIcon by pointing
+ // the page's <link rel="icon"> at a blob: URL of the encoded surface -
+ // a reasonable desktop-icon mapping in general, but unwanted here where
+ // the embedding page already has its own favicon. Skip it on this target
+ // rather than fight it from the host page's JS.
if (auto icon = BaseTexture::CreateFromFile(g_app->m_fileLocator.GetAppPath(FileLocator::AppSubFolder::Assets, "vpinball.png")); icon)
{
SDL_Surface* pSurface = icon->ToSDLSurface();
@@ -276,6 +282,7 @@ Window::Window(const string& title, const Settings& settings, VPXWindowId window
else {
PLOGE << "Failed to load window icon: " << SDL_GetError();
}
+#endif
// Check if the platform allows positioning windows (as Wayland forbids it...)
{