[gnome-settings-daemon] Be more careful when comparing two key structs



commit aa77197e1616b991fe3b2f1d606a4592626d39b3
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Jun 15 01:56:48 2009 -0400

    Be more careful when comparing two key structs
    
    With the current code, whenever one of them had keycodes == NULL,
    they were considered the same. Which is exactly what happens when
    creating a new custom binding, or removing one. Fixes bug 580616.

 plugins/keybindings/gsd-keybindings-manager.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/keybindings/gsd-keybindings-manager.c b/plugins/keybindings/gsd-keybindings-manager.c
index 8bd3714..342e12f 100644
--- a/plugins/keybindings/gsd-keybindings-manager.c
+++ b/plugins/keybindings/gsd-keybindings-manager.c
@@ -267,7 +267,9 @@ same_key (const Key *key, const Key *other)
                                      if (*c1 != *c2)
                                         return FALSE;
                         }
-                }
+                } else if (key->keycodes != NULL || other->keycodes != NULL)
+                        return FALSE;
+
 
                 return TRUE;
         }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]