After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 452636 - No option to turn off the animated box effect when minimize a window
No option to turn off the animated box effect when minimize a window
Status: RESOLVED DUPLICATE of bug 92867
Product: metacity
Classification: Other
Component: Søren's compositor
2.18.x
Other Linux
: Normal normal
: ---
Assigned To: Metacity compositor maintainers
Metacity compositor maintainers
Depends on:
Blocks:
 
 
Reported: 2007-06-30 19:51 UTC by Bruno Gola
Modified: 2007-12-08 15:13 UTC
See Also:
GNOME target: ---
GNOME version: 2.17/2.18



Description Bruno Gola 2007-06-30 19:51:48 UTC
This patch enable the user to choose if he wants the animation (black border) when minimizing a window. 

The option will appear in gconf-editor at /apps/metacity/general/minimize_animation_box (boolean value).


diff -Naur metacity-2.18.2/src/effects.c metacity-2.18.2.new/src/effects.c
--- metacity-2.18.2/src/effects.c       2007-04-08 15:46:17.000000000 -0300
+++ metacity-2.18.2.new/src/effects.c   2007-06-30 16:16:13.000000000 -0300
@@ -755,17 +755,18 @@
 
 static void
 run_default_effect_handler (MetaEffect *effect)
-{
+{   
     switch (effect->type)
     {
     case META_EFFECT_MINIMIZE:
-       meta_effects_draw_box_animation (effect->window->screen,
+       if (meta_prefs_get_minimize_animation_box ()) {
+               meta_effects_draw_box_animation (effect->window->screen,
                                         &(effect->u.minimize.window_rect),
                                         &(effect->u.minimize.icon_rect),
                                         META_MINIMIZE_ANIMATION_LENGTH,
                                         META_BOX_ANIM_SCALE);
+       }
        break;
-
     default:
        break;
     }
diff -Naur metacity-2.18.2/src/metacity.schemas.in metacity-2.18.2.new/src/metacity.schemas.in
--- metacity-2.18.2/src/metacity.schemas.in     2007-04-08 15:46:17.000000000 -0300
+++ metacity-2.18.2.new/src/metacity.schemas.in 2007-06-30 16:15:01.000000000 -0300
@@ -335,6 +335,17 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/metacity/general/minimize_animation_box</key>
+      <applyto>/apps/metacity/general/minimize_animation_box</applyto>
+      <owner>metacity</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+         <short>If true, shows a black border when minimize windows</short>
+      </locale>
+    </schema>
+
     <!-- Window Keybindings -->
 
     <schema>
diff -Naur metacity-2.18.2/src/prefs.c metacity-2.18.2.new/src/prefs.c
--- metacity-2.18.2/src/prefs.c 2007-04-08 15:46:17.000000000 -0300
+++ metacity-2.18.2.new/src/prefs.c     2007-06-30 16:14:37.000000000 -0300
@@ -57,6 +57,7 @@
 #define KEY_DISABLE_WORKAROUNDS "/apps/metacity/general/disable_workarounds"
 #define KEY_BUTTON_LAYOUT "/apps/metacity/general/button_layout"
 #define KEY_REDUCED_RESOURCES "/apps/metacity/general/reduced_resources"
+#define KEY_MINIMIZE_ANIMATION_BOX "/apps/metacity/general/minimize_animation_box"
 #define KEY_GNOME_ACCESSIBILITY "/desktop/gnome/interface/accessibility"
 
 #define KEY_COMMAND_PREFIX "/apps/metacity/keybinding_commands/command_"
@@ -100,6 +101,7 @@
 static gboolean provide_visual_bell = FALSE;
 static gboolean bell_is_audible = TRUE;
 static gboolean reduced_resources = FALSE;
+static gboolean minimize_animation_box = TRUE;
 static gboolean gnome_accessibility = FALSE;
 static char *cursor_theme = NULL;
 static int   cursor_size = 24;
@@ -162,6 +164,7 @@
 static gboolean update_workspace_name     (const char  *name,
                                            const char  *value);
 static gboolean update_reduced_resources  (gboolean     value);
+static gboolean update_minimize_animation_box (gboolean        value);
 static gboolean update_gnome_accessibility  (gboolean     value);
 static gboolean update_cursor_theme       (const char *value);
 static gboolean update_cursor_size        (int size);
@@ -489,6 +492,9 @@
   if (get_bool (KEY_REDUCED_RESOURCES, &bool_val))
     update_reduced_resources (bool_val);
 
+  if (get_bool (KEY_MINIMIZE_ANIMATION_BOX, &bool_val))
+    update_minimize_animation_box (bool_val);
+
   str_val = gconf_client_get_string (default_client, KEY_TERMINAL_COMMAND,
                                      &err);
   cleanup_error (&err);
@@ -975,6 +981,23 @@
       if (update_reduced_resources (b))
         queue_changed (META_PREF_REDUCED_RESOURCES);
     }
+  else if (strcmp (key, KEY_MINIMIZE_ANIMATION_BOX) == 0)
+    {
+      gboolean b;
+
+      if (value && value->type != GCONF_VALUE_BOOL)
+        {
+          meta_warning (_("GConf key \"%s\" is set to an invalid type\n"),
+                        KEY_MINIMIZE_ANIMATION_BOX);
+          goto out;
+        }
+
+      b = value ? gconf_value_get_bool (value) : minimize_animation_box;
+
+      if (update_minimize_animation_box (b))
+        queue_changed (META_PREF_MINIMIZE_ANIMATION_BOX);
+    }
+
   else if (strcmp (key, KEY_GNOME_ACCESSIBILITY) == 0)
     {
       gboolean b;
@@ -1706,6 +1728,16 @@
 }
 
 static gboolean
+update_minimize_animation_box (gboolean value)
+{
+  gboolean old = minimize_animation_box;
+
+  minimize_animation_box = value;
+
+  return old != minimize_animation_box;
+}
+
+static gboolean
 update_gnome_accessibility (gboolean value)
 {
   gboolean old = gnome_accessibility;
@@ -1788,6 +1820,9 @@
     case META_PREF_REDUCED_RESOURCES:
       return "REDUCED_RESOURCES";
 
+    case META_PREF_MINIMIZE_ANIMATION_BOX:
+      return "MINIMIZE_ANIMATION_BOX";
+
     case META_PREF_GNOME_ACCESSIBILITY:
       return "GNOME_ACCESSIBILTY";
 
@@ -2898,6 +2933,12 @@
 }
 
 gboolean
+meta_prefs_get_minimize_animation_box (void)
+{
+  return minimize_animation_box;
+}
+
+gboolean
 meta_prefs_get_gnome_accessibility ()
 {
   return gnome_accessibility;
diff -Naur metacity-2.18.2/src/prefs.h metacity-2.18.2.new/src/prefs.h
--- metacity-2.18.2/src/prefs.h 2007-04-08 15:46:17.000000000 -0300
+++ metacity-2.18.2.new/src/prefs.h     2007-06-30 16:14:37.000000000 -0300
@@ -53,6 +53,7 @@
   META_PREF_AUDIBLE_BELL,
   META_PREF_VISUAL_BELL_TYPE,
   META_PREF_REDUCED_RESOURCES,
+  META_PREF_MINIMIZE_ANIMATION_BOX,
   META_PREF_GNOME_ACCESSIBILITY,
   META_PREF_CURSOR_THEME,
   META_PREF_CURSOR_SIZE,
@@ -83,6 +84,7 @@
 gboolean                    meta_prefs_get_auto_raise         (void);
 int                         meta_prefs_get_auto_raise_delay   (void);
 gboolean                    meta_prefs_get_reduced_resources  (void);
+gboolean                    meta_prefs_get_minimize_animation_box  (void);
 gboolean                    meta_prefs_get_gnome_accessibility (void);
 
 const char*                 meta_prefs_get_command            (int i);


patch by 
brunogola at gmail dot com 
grabber at gmail dot com
Comment 1 Alessandro Guido 2007-12-08 05:21:15 UTC
come on, please give us a way to kill that crappy animation (it would be even better to kill entirely the animation code).
Better to leave effects to WMs designed to do them.
Comment 2 Grabber 2007-12-08 14:55:37 UTC
I develop this patch with brunogola, we are trying to get it accepted in gnome tree. But a lot of peoples don't like it. I really don't know why?!
New animation code design will implement news options to gconf-editor and gnome don't like it.
Comment 3 Elijah Newren 2007-12-08 15:13:47 UTC
Thanks for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.


*** This bug has been marked as a duplicate of 92867 ***