From 676a002aa39dde336e2dd4eac2f8449d83a8e21f Mon Sep 17 00:00:00 2001 From: Jack Andersen Date: Mon, 1 Jan 2018 19:09:15 -1000 Subject: [PATCH] Xlib application icon fix --- lib/x11/ApplicationUnix.cpp | 4 ++++ lib/x11/WindowXlib.cpp | 6 +----- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/x11/ApplicationUnix.cpp b/lib/x11/ApplicationUnix.cpp index dd1c664..25152e5 100644 --- a/lib/x11/ApplicationUnix.cpp +++ b/lib/x11/ApplicationUnix.cpp @@ -10,6 +10,10 @@ #include #include +/* No icon by default */ +extern "C" const uint8_t MAINICON_NETWM[] __attribute__ ((weak)) = {}; +extern "C" const size_t MAINICON_NETWM_SZ __attribute__ ((weak)) = 0; + DBusConnection* RegisterDBus(const char* appName, bool& isFirst) { isFirst = true; diff --git a/lib/x11/WindowXlib.cpp b/lib/x11/WindowXlib.cpp index 3a07cde..d782b52 100644 --- a/lib/x11/WindowXlib.cpp +++ b/lib/x11/WindowXlib.cpp @@ -107,10 +107,6 @@ static const int ContextAttribList[7][7] = extern "C" const uint8_t MAINICON_NETWM[]; extern "C" const size_t MAINICON_NETWM_SZ; -/* No icon by default */ -extern const uint8_t MAINICON_NETWM[] __attribute__ ((weak)) = {}; -extern const size_t MAINICON_NETWM_SZ __attribute__ ((weak)) = 0; - namespace boo { static logvisor::Module Log("boo::WindowXlib"); @@ -1051,7 +1047,7 @@ public: /* Add window icon */ if (MAINICON_NETWM_SZ && S_ATOMS->m_netwmIcon) { - XChangeProperty(display, m_windowId, S_ATOMS->m_netwmIcon, XA_CARDINAL, + XChangeProperty(m_xDisp, m_windowId, S_ATOMS->m_netwmIcon, XA_CARDINAL, 32, PropModeReplace, MAINICON_NETWM, MAINICON_NETWM_SZ / sizeof(unsigned long)); }