X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9ff9d30c0aab3b281ef9b380eac17435556c5088..79cb759dc8580da2e82e880cd94a08cd38bb814e:/src/gtk/taskbar.cpp diff --git a/src/gtk/taskbar.cpp b/src/gtk/taskbar.cpp index 80bfd6b119..ee192ae7b9 100644 --- a/src/gtk/taskbar.cpp +++ b/src/gtk/taskbar.cpp @@ -60,23 +60,17 @@ wxTaskBarIconAreaBase::wxTaskBarIconAreaBase() bool wxTaskBarIconAreaBase::IsProtocolSupported() { - static int s_supported = -1; - if (s_supported == -1) - { - Display *display = GDK_DISPLAY(); - Screen *screen = DefaultScreenOfDisplay(display); - - char name[32]; - g_snprintf(name, sizeof(name), "_NET_SYSTEM_TRAY_S%d", - XScreenNumberOfScreen(screen)); - Atom atom = XInternAtom(display, name, False); + Display *display = GDK_DISPLAY(); + Screen *screen = DefaultScreenOfDisplay(display); - Window manager = XGetSelectionOwner(display, atom); + char name[32]; + g_snprintf(name, sizeof(name), "_NET_SYSTEM_TRAY_S%d", + XScreenNumberOfScreen(screen)); + Atom atom = XInternAtom(display, name, False); - s_supported = (manager != None); - } + Window manager = XGetSelectionOwner(display, atom); - return (bool)s_supported; + return (manager != None); } //-----------------------------------------------------------------------------