]> spindle.queued.net Git - midori/commitdiff
Use DESKTOP_SESSION variable if set to look for Xfce
authorChristian Dywan <christian@twotoasts.de>
Tue, 8 Feb 2011 18:10:00 +0000 (19:10 +0100)
committerChristian Dywan <christian@twotoasts.de>
Tue, 8 Feb 2011 18:10:40 +0000 (19:10 +0100)
midori/sokoke.c

index 1a7a4d29e48203a1af453f0ea738a495b7e6361a..b772bab533da4db5830e56f217867392dff1e483 100644 (file)
@@ -970,7 +970,16 @@ sokoke_get_desktop (void)
     static SokokeDesktop desktop = SOKOKE_DESKTOP_UNTESTED;
     if (G_UNLIKELY (desktop == SOKOKE_DESKTOP_UNTESTED))
     {
-        /* Are we running in Xfce? */
+        desktop = SOKOKE_DESKTOP_UNKNOWN;
+
+        /* Are we running in Xfce >= 4.8? */
+        if (!g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "xfce"))
+        {
+            desktop = SOKOKE_DESKTOP_XFCE;
+        }
+        else
+        {
+        /* Are we running in Xfce <= 4.6? */
         GdkDisplay* display = gdk_display_get_default ();
         Display* xdisplay = GDK_DISPLAY_XDISPLAY (display);
         Window root_window = RootWindow (xdisplay, 0);
@@ -984,13 +993,13 @@ sokoke_get_desktop (void)
             save_mode_atom, 0, (~0L),
             False, AnyPropertyType, &actual_type, &actual_format,
             &n_items, &bytes, (unsigned char**)&value);
-        desktop = SOKOKE_DESKTOP_UNKNOWN;
         if (status == Success)
         {
             if (n_items == 6 && !strncmp (value, "xfce4", 6))
                 desktop = SOKOKE_DESKTOP_XFCE;
             XFree (value);
         }
+        }
     }
 
     return desktop;