# Description: add a gconf key (/desktop/gnome/interface/hide_decorator_tooltip)
# to disable tooltip in decorator bar. If key not present, show the tooltip.
# Origin: Ubuntu
# Bug: 
# Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/compiz/+bug/519856

Index: metacity-2.28.1/src/core/prefs.c
===================================================================
--- metacity-2.28.1.orig/src/core/prefs.c	2010-02-10 17:24:35.275186445 +0100
+++ metacity-2.28.1/src/core/prefs.c	2010-02-10 17:35:15.027187046 +0100
@@ -98,6 +97,7 @@
 static gboolean compositing_manager = FALSE;
 static gboolean resize_with_right_button = FALSE;
 static gboolean force_fullscreen = TRUE;
+static gboolean hide_decorator_tooltip = FALSE;
 
 static MetaVisualBellType visual_bell_type = META_VISUAL_BELL_FULLSCREEN_FLASH;
 static MetaButtonLayout button_layout;
@@ -413,6 +413,11 @@
       &resize_with_right_button,
       FALSE,
     },
+    { "/desktop/gnome/interface/hide_decorator_tooltip",
+      META_PREF_HIDE_DECORATOR_TOOLTIP,
+      &hide_decorator_tooltip,
+      FALSE,
+    },
     { NULL, 0, NULL, FALSE },
   };
 
@@ -1263,6 +1268,12 @@
   return raise_on_click;
 }
 
+gboolean
+meta_prefs_get_hide_decorator_tooltip (void)
+{
+  return hide_decorator_tooltip;
+}
+
 const char*
 meta_prefs_get_theme (void)
 {
@@ -1755,6 +1766,9 @@
 
     case META_PREF_FORCE_FULLSCREEN:
       return "FORCE_FULLSCREEN";
+
+    case META_PREF_HIDE_DECORATOR_TOOLTIP:
+      return "HIDE_DECORATOR_TOOLTIP";
     }
 
   return "(unknown)";
Index: metacity-2.28.1/src/include/prefs.h
===================================================================
--- metacity-2.28.1.orig/src/include/prefs.h	2010-02-10 17:36:20.996188412 +0100
+++ metacity-2.28.1/src/include/prefs.h	2010-02-10 17:37:14.452187638 +0100
@@ -60,7 +60,8 @@
   META_PREF_CURSOR_SIZE,
   META_PREF_COMPOSITING_MANAGER,
   META_PREF_RESIZE_WITH_RIGHT_BUTTON,
-  META_PREF_FORCE_FULLSCREEN
+  META_PREF_FORCE_FULLSCREEN,
+  META_PREF_HIDE_DECORATOR_TOOLTIP
 } MetaPreference;
 
 typedef void (* MetaPrefsChangedFunc) (MetaPreference pref,
@@ -80,6 +81,7 @@
 MetaFocusMode               meta_prefs_get_focus_mode         (void);
 MetaFocusNewWindows         meta_prefs_get_focus_new_windows  (void);
 gboolean                    meta_prefs_get_raise_on_click     (void);
+gboolean                    meta_prefs_get_hide_decorator_tooltip (void);
 const char*                 meta_prefs_get_theme              (void);
 /* returns NULL if GTK default should be used */
 const PangoFontDescription* meta_prefs_get_titlebar_font      (void);
Index: metacity-2.28.1/src/ui/frames.c
===================================================================
--- metacity-2.28.1.orig/src/ui/frames.c	2010-02-10 17:09:36.067187386 +0100
+++ metacity-2.28.1/src/ui/frames.c	2010-02-10 17:38:16.231186443 +0100
@@ -1100,6 +1102,9 @@
   if (frame == NULL)
     return;
 
+  if (meta_prefs_get_hide_decorator_tooltip ())
+    return;
+
   XQueryPointer (gdk_display,
                  frame->xwindow,
                  &root, &child,
