[Xfce4-commits] r29572 - in xfwm4/trunk: . settings-dialogs

Olivier Fourdan olivier at xfce.org
Tue Feb 24 19:53:37 CET 2009


Author: olivier
Date: 2009-02-24 18:53:37 +0000 (Tue, 24 Feb 2009)
New Revision: 29572

Modified:
   xfwm4/trunk/ChangeLog
   xfwm4/trunk/settings-dialogs/tweaks-settings.c
   xfwm4/trunk/settings-dialogs/xfwm4-settings.c
Log:
	* settings-dialogs/xfwm4-settings.c, 
	  settings-dialogs/tweaks-settings.c: Do not run setting dialogs if
	  current window manager is not xfwm4 (Bug #4989).

Modified: xfwm4/trunk/ChangeLog
===================================================================
--- xfwm4/trunk/ChangeLog	2009-02-24 16:20:14 UTC (rev 29571)
+++ xfwm4/trunk/ChangeLog	2009-02-24 18:53:37 UTC (rev 29572)
@@ -1,3 +1,9 @@
+2009-02-24	olivier
+
+	* settings-dialogs/xfwm4-settings.c, 
+	  settings-dialogs/tweaks-settings.c: Do not run setting dialogs if
+	  current window manager is not xfwm4 (Bug #4989).
+
 2009-02-23	olivier
 
 	* src/cycle.c, src/moveresize.c: Make sure any active grab on the

Modified: xfwm4/trunk/settings-dialogs/tweaks-settings.c
===================================================================
--- xfwm4/trunk/settings-dialogs/tweaks-settings.c	2009-02-24 16:20:14 UTC (rev 29571)
+++ xfwm4/trunk/settings-dialogs/tweaks-settings.c	2009-02-24 18:53:37 UTC (rev 29572)
@@ -18,8 +18,13 @@
  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
+
+#ifdef HAVE_STRING_H
 #include <string.h>
+#endif
 
 #include <glib.h>
 
@@ -425,6 +430,7 @@
     GtkWidget *plug_child;
     GladeXML *gxml;
     GError *cli_error = NULL;
+    const gchar  *wm_name;
 
 #ifdef ENABLE_NLS
     xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
@@ -440,6 +446,13 @@
         }
     }
 
+    wm_name = gdk_x11_screen_get_window_manager_name (gdk_screen_get_default ());
+    if (G_UNLIKELY (g_ascii_strcasecmp (wm_name, "Xfwm4")))
+    {
+        g_print ("These settings cannot work with your current window manager (%s)\n", wm_name);
+        return 1;
+    }
+
     if (opt_version)
     {
         g_print ("%s\n", PACKAGE_STRING);

Modified: xfwm4/trunk/settings-dialogs/xfwm4-settings.c
===================================================================
--- xfwm4/trunk/settings-dialogs/xfwm4-settings.c	2009-02-24 16:20:14 UTC (rev 29571)
+++ xfwm4/trunk/settings-dialogs/xfwm4-settings.c	2009-02-24 18:53:37 UTC (rev 29572)
@@ -926,8 +926,11 @@
   GtkWidget    *dialog;
   GtkWidget    *plug;
   GError       *error = NULL;
+  const gchar  *wm_name;
 
+#ifdef ENABLE_NLS
   xfce_textdomain (GETTEXT_PACKAGE, LOCALEDIR, "UTF-8");
+#endif
 
   if (G_UNLIKELY (!gtk_init_with_args (&argc, &argv, _("."), opt_entries, PACKAGE, &error)))
     {
@@ -941,6 +944,13 @@
       return EXIT_FAILURE;
     }
 
+  wm_name = gdk_x11_screen_get_window_manager_name (gdk_screen_get_default ());
+  if (G_UNLIKELY (g_ascii_strcasecmp (wm_name, "Xfwm4")))
+    {
+      g_print ("These settings cannot work with your current window manager (%s)\n", wm_name);
+      return EXIT_FAILURE;
+    }
+
   if (G_UNLIKELY (opt_version))
     {
       g_print ("%s\n", PACKAGE_STRING);




More information about the Xfce4-commits mailing list