]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/taskbar.cpp
don't include private headers from wx/unix/evtloop.h
[wxWidgets.git] / src / gtk / taskbar.cpp
index 8035e5b3424ab6d59be2f2da24a9da3bbe2e7951..ee192ae7b92c0f220f0d38145bdd5310da7a7300 100644 (file)
@@ -32,6 +32,7 @@ wxTaskBarIconAreaBase::wxTaskBarIconAreaBase()
     if (IsProtocolSupported())
     {
         m_widget = GTK_WIDGET(egg_tray_icon_new("systray icon"));
+        g_object_ref(m_widget);
         gtk_window_set_resizable(GTK_WINDOW(m_widget), false);
 
         wxLogTrace(_T("systray"), _T("using freedesktop.org systray spec"));
@@ -59,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);
 }
 
 //-----------------------------------------------------------------------------