GUACAMOLE-1387: Merge update and filter tiled connections only if group is actually changing.

diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java
index 769d4c3..2071dfa 100644
--- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java
+++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/ConfigurationService.java
@@ -322,6 +322,26 @@
     }
 
     /**
+     * Returns the search filter that should be used when querying the
+     * LDAP server for Guacamole groups.  If no filter is specified,
+     * a default of "(objectClass=*)" is used.
+     *
+     * @return
+     *     The search filter that should be used when querying the
+     *     LDAP server for groups that are valid in Guacamole, or
+     *     "(objectClass=*)" if not specified.
+     *
+     * @throws GuacamoleException
+     *     If guacamole.properties cannot be parsed.
+     */
+    public ExprNode getGroupSearchFilter() throws GuacamoleException {
+        return environment.getProperty(
+            LDAPGuacamoleProperties.LDAP_GROUP_SEARCH_FILTER,
+            new PresenceNode("objectClass")
+        );
+    }
+
+    /**
      * Returns the maximum number of seconds to wait for LDAP operations.
      *
      * @return
diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java
index 2313629..5bf5cfb 100644
--- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java
+++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/conf/LDAPGuacamoleProperties.java
@@ -211,6 +211,17 @@
     };
 
     /**
+     * A search filter to apply to group LDAP queries.
+     */
+    public static final LdapFilterGuacamoleProperty LDAP_GROUP_SEARCH_FILTER =
+            new LdapFilterGuacamoleProperty() {
+
+        @Override
+        public String getName() { return "ldap-group-search-filter"; }
+
+    };
+
+    /**
      * Whether or not we should follow referrals.
      */
     public static final BooleanGuacamoleProperty LDAP_FOLLOW_REFERRALS =
diff --git a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java
index 66f4612..6d97a93 100644
--- a/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java
+++ b/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/group/UserGroupService.java
@@ -28,10 +28,10 @@
 import java.util.Set;
 import org.apache.directory.api.ldap.model.entry.Entry;
 import org.apache.directory.api.ldap.model.exception.LdapInvalidAttributeValueException;
+import org.apache.directory.api.ldap.model.filter.AndNode;
 import org.apache.directory.api.ldap.model.filter.EqualityNode;
 import org.apache.directory.api.ldap.model.filter.ExprNode;
 import org.apache.directory.api.ldap.model.filter.NotNode;
-import org.apache.directory.api.ldap.model.filter.PresenceNode;
 import org.apache.directory.api.ldap.model.name.Dn;
 import org.apache.directory.ldap.client.api.LdapNetworkConnection;
 import org.apache.guacamole.auth.ldap.conf.ConfigurationService;
@@ -81,16 +81,22 @@
      */
     private ExprNode getGroupSearchFilter() throws GuacamoleException {
 
+        // Use filter defined by "ldap-group-search-filter" as basis for all
+        // retrieval of user groups
+        ExprNode groupFilter = confService.getGroupSearchFilter();
+
         // Explicitly exclude guacConfigGroup object class only if it should
         // be assumed to be defined (query may fail due to no such object
         // class existing otherwise)
-        if (confService.getConfigurationBaseDN() != null)
-            return new NotNode(new EqualityNode("objectClass","guacConfigGroup"));
+        if (confService.getConfigurationBaseDN() != null) {
+            groupFilter = new AndNode(
+                groupFilter,
+                new NotNode(new EqualityNode<String>("objectClass", "guacConfigGroup"))
+            );
+        }
 
-        // Read any object as a group if LDAP is not being used for connection
-        // storage (guacConfigGroup)
-        return new PresenceNode("objectClass");
-
+        return groupFilter;
+        
     }
 
     /**
diff --git a/guacamole-common-js/src/main/webapp/modules/Keyboard.js b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
index c6b40eb..8f7dfe4 100644
--- a/guacamole-common-js/src/main/webapp/modules/Keyboard.js
+++ b/guacamole-common-js/src/main/webapp/modules/Keyboard.js
@@ -437,9 +437,9 @@
         40:  [0xFF54, 0xFF54, 0xFF54, 0xFFB2], // down arrow  / KP 2
         45:  [0xFF63, 0xFF63, 0xFF63, 0xFFB0], // insert      / KP 0
         46:  [0xFFFF, 0xFFFF, 0xFFFF, 0xFFAE], // delete      / KP decimal
-        91:  [0xFFEB], // left window key (hyper_l)
-        92:  [0xFF67], // right window key (menu key?)
-        93:  null,     // select key
+        91:  [0xFFE7], // left windows/command key (meta_l)
+        92:  [0xFFE8], // right window/command key (meta_r)
+        93:  [0xFF67], // menu key
         96:  [0xFFB0], // KP 0
         97:  [0xFFB1], // KP 1
         98:  [0xFFB2], // KP 2
@@ -583,7 +583,7 @@
         "UIKeyInputUpArrow": [0xFF52],
         "Up": [0xFF52],
         "Undo": [0xFF65],
-        "Win": [0xFFEB],
+        "Win": [0xFFE7, 0xFFE7, 0xFFE8],
         "Zenkaku": [0xFF28],
         "ZenkakuHankaku": [0xFF2A]
     };
@@ -603,8 +603,8 @@
         0xFFE8: true, // Right meta 
         0xFFE9: true, // Left alt
         0xFFEA: true, // Right alt
-        0xFFEB: true, // Left hyper
-        0xFFEC: true  // Right hyper
+        0xFFEB: true, // Left super/hyper
+        0xFFEC: true  // Right super/hyper
     };
 
     /**
@@ -1031,8 +1031,8 @@
 
         // Resync state of hyper
         updateModifierState(guac_keyboard.modifiers.hyper, state.hyper, [
-            0xFFEB, // Left hyper
-            0xFFEC  // Right hyper
+            0xFFEB, // Left super/hyper
+            0xFFEC  // Right super/hyper
         ], keyEvent);
 
         // Update state
diff --git a/guacamole-docker/bin/start.sh b/guacamole-docker/bin/start.sh
index e6bd50e..062e16a 100755
--- a/guacamole-docker/bin/start.sh
+++ b/guacamole-docker/bin/start.sh
@@ -443,6 +443,7 @@
     set_optional_property "ldap-user-search-filter"         "$LDAP_USER_SEARCH_FILTER"
     set_optional_property "ldap-config-base-dn"             "$LDAP_CONFIG_BASE_DN"
     set_optional_property "ldap-group-base-dn"              "$LDAP_GROUP_BASE_DN"
+    set_optional_property "ldap-group-search-filter"        "$LDAP_GROUP_SEARCH_FILTER"
     set_optional_property "ldap-member-attribute-type"      "$LDAP_MEMBER_ATTRIBUTE_TYPE"
     set_optional_property "ldap-group-name-attribute"       "$LDAP_GROUP_NAME_ATTRIBUTE"
     set_optional_property "ldap-dereference-aliases"        "$LDAP_DEREFERENCE_ALIASES"
diff --git a/guacamole/src/main/frontend/src/layouts/de-de-qwertz.json b/guacamole/src/main/frontend/src/layouts/de-de-qwertz.json
index 2b746aa..052a3a7 100644
--- a/guacamole/src/main/frontend/src/layouts/de-de-qwertz.json
+++ b/guacamole/src/main/frontend/src/layouts/de-de-qwertz.json
@@ -78,7 +78,6 @@
 
         "Menu" : [{
             "title"    : "Menu",
-            "modifier" : "super",
             "keysym"   : 65383
         }],
         "LShift" : [{
@@ -116,10 +115,10 @@
             "modifier" : "alt-gr",
             "keysym"   : 65027
         }],
-        "Super" : [{
-            "title"    : "Super",
-            "modifier" : "super",
-            "keysym"   : 65515
+        "Meta" : [{
+            "title"    : "Meta",
+            "modifier" : "meta",
+            "keysym"   : 65511
         }],
 
         "^" : [
@@ -404,7 +403,7 @@
                     [ "Tab", "q", "w", "e", "r", "t", "z", "u", "i", "o", "p", "ü", "+",   1,  0.6 ],
                     [ "Caps",  "a", "s", "d", "f", "g", "h", "j", "k", "l", "ö", "ä", "#", "Enter" ],
                     [ "LShift", "<", "y", "x", "c", "v",  "b", "n",  "m", ",", ".", "-",  "RShift" ],
-                    [ "LCtrl", "Super", "LAlt",         "Space",          "AltGr", "Menu", "RCtrl" ]
+                    [ "LCtrl", "Meta", "LAlt",          "Space",          "AltGr", "Menu", "RCtrl" ]
 
                 ],
 
@@ -431,7 +430,7 @@
         "RShift" : 2.1,
 
         "LCtrl" : 1.6,
-        "Super" : 1.6,
+        "Meta" : 1.6,
         "LAlt"  : 1.6,
         "Space" : 6.1,
         "AltGr" : 1.6,
diff --git a/guacamole/src/main/frontend/src/layouts/en-us-qwerty.json b/guacamole/src/main/frontend/src/layouts/en-us-qwerty.json
index 13b2ddb..fa9a6fe 100644
--- a/guacamole/src/main/frontend/src/layouts/en-us-qwerty.json
+++ b/guacamole/src/main/frontend/src/layouts/en-us-qwerty.json
@@ -87,10 +87,10 @@
             "modifier" : "alt",
             "keysym"   : 65514
         }],
-        "Super" : [{
-            "title"    : "Super",
-            "modifier" : "super",
-            "keysym"   : 65515
+        "Meta" : [{
+            "title"    : "Meta",
+            "modifier" : "meta",
+            "keysym"   : 65511
         }],
 
         "`" : [
@@ -353,7 +353,7 @@
                     [ "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "[", "]", "\\" ],
                     [ "Caps",  "a", "s", "d", "f", "g", "h", "j", "k", "l", ";", "'", "Enter" ],
                     [ "LShift", "z", "x", "c", "v",  "b", "n",  "m", ",", ".", "/",  "RShift" ],
-                    [ "LCtrl", "Super", "LAlt",       "Space",        "RAlt", "Menu", "RCtrl" ]
+                    [ "LCtrl", "Meta", "LAlt",        "Space",        "RAlt", "Menu", "RCtrl" ]
 
                 ],
 
@@ -380,7 +380,7 @@
         "RShift" : 3.1,
 
         "LCtrl" : 1.6,
-        "Super" : 1.6,
+        "Meta" : 1.6,
         "LAlt"  : 1.6,
         "Space" : 6.1,
         "RAlt"  : 1.6,
diff --git a/guacamole/src/main/frontend/src/layouts/es-es-qwerty.json b/guacamole/src/main/frontend/src/layouts/es-es-qwerty.json
index dc330e5..e88c6cd 100644
--- a/guacamole/src/main/frontend/src/layouts/es-es-qwerty.json
+++ b/guacamole/src/main/frontend/src/layouts/es-es-qwerty.json
@@ -78,7 +78,6 @@
 

         "Menu" : [{

             "title"    : "Menu",

-            "modifier" : "super",

             "keysym"   : 65383

         }],

         "LShift" : [{

@@ -116,10 +115,10 @@
             "modifier" : "alt-gr",

             "keysym"   : 65027

         }],

-        "Super" : [{

-            "title"    : "Super",

-            "modifier" : "super",

-            "keysym"   : 65515

+        "Meta" : [{

+            "title"    : "Meta",

+            "modifier" : "meta",

+            "keysym"   : 65511

         }],

 

         "º" : [

@@ -410,7 +409,7 @@
                     [ "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "`", "+",   1,  0.6 ],

                     [ "Caps",  "a", "s", "d", "f", "g", "h", "j", "k", "l", "ñ", "´", "ç", "Enter" ],

                     [ "LShift", "<", "z", "x", "c", "v",  "b", "n",  "m", ",", ".", "-",  "RShift" ],

-                    [ "LCtrl", "Super", "LAlt",         "Space",          "AltGr", "Menu", "RCtrl" ]

+                    [ "LCtrl", "Meta", "LAlt",          "Space",          "AltGr", "Menu", "RCtrl" ]

 

                 ],

 

@@ -437,7 +436,7 @@
         "RShift" : 2.2,

 

         "LCtrl" : 1.6,

-        "Super" : 1.6,

+        "Meta" : 1.6,

         "LAlt"  : 1.6,

         "Space" : 6.4,

         "AltGr" : 1.6,

diff --git a/guacamole/src/main/frontend/src/layouts/fr-fr-azerty.json b/guacamole/src/main/frontend/src/layouts/fr-fr-azerty.json
index f248907..bf3eaf3 100644
--- a/guacamole/src/main/frontend/src/layouts/fr-fr-azerty.json
+++ b/guacamole/src/main/frontend/src/layouts/fr-fr-azerty.json
@@ -118,10 +118,10 @@
             "modifier" : "alt-gr",
             "keysym"   : 65027
         }],
-        "Super" : [{
-            "title"    : "Super",
-            "modifier" : "super",
-            "keysym"   : 65515
+        "Meta" : [{
+            "title"    : "Meta",
+            "modifier" : "meta",
+            "keysym"   : 65511
         }],
 
         "²" : [
@@ -400,7 +400,7 @@
                     [ "Tab", "a", "z", "e", "r", "t", "y", "u", "i", "o", "p", "^", "$", 1, 0.8 ],
                     [ "Caps",  "q", "s", "d", "f", "g", "h", "j", "k", "l", "m", "ù", "*", "Enter" ],
                     [ "LShift", "<", "w", "x", "c", "v",  "b", "n", ",", ";", ":", "!", "RShift" ],
-                    [ "LCtrl", "Super", "LAlt",       "Space",        "AltGr", "Menu", "RCtrl" ]
+                    [ "LCtrl", "Meta", "LAlt",        "Space",        "AltGr", "Menu", "RCtrl" ]
 
                 ],
 
@@ -427,7 +427,7 @@
         "RShift" : 2.1,
 
         "LCtrl" : 1.6,
-        "Super" : 1.6,
+        "Meta" : 1.6,
         "LAlt"  : 1.6,
         "Space" : 6.1,
         "AltGr" : 1.6,
diff --git a/guacamole/src/main/frontend/src/layouts/it-it-qwerty.json b/guacamole/src/main/frontend/src/layouts/it-it-qwerty.json
index 17ae06d..4775e6f 100644
--- a/guacamole/src/main/frontend/src/layouts/it-it-qwerty.json
+++ b/guacamole/src/main/frontend/src/layouts/it-it-qwerty.json
@@ -78,7 +78,6 @@
 
         "Menu" : [{
             "title"    : "Menu",
-            "modifier" : "super",
             "keysym"   : 65383
         }],
         "LShift" : [{
@@ -116,10 +115,10 @@
             "modifier" : "alt-gr",
             "keysym"   : 65027
         }],
-        "Super" : [{
-            "title"    : "Super",
-            "modifier" : "super",
-            "keysym"   : 65515
+        "Meta" : [{
+            "title"    : "Meta",
+            "modifier" : "meta",
+            "keysym"   : 65511
         }],
 
         "\\" : [
@@ -407,7 +406,7 @@
                     [ "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "è", "+",   1,  0.6 ],
                     [ "Caps",  "a", "s", "d", "f", "g", "h", "j", "k", "l", "ò", "à", "ù", "Enter" ],
                     [ "LShift", "<", "z", "x", "c", "v",  "b", "n",  "m", ",", ".", "-",  "RShift" ],
-                    [ "LCtrl", "Super", "LAlt",         "Space",          "AltGr", "Menu", "RCtrl" ]
+                    [ "LCtrl", "Meta", "LAlt",          "Space",          "AltGr", "Menu", "RCtrl" ]
 
                 ],
 
@@ -434,7 +433,7 @@
         "RShift" : 2.2,
 
         "LCtrl" : 1.6,
-        "Super" : 1.6,
+        "Meta" : 1.6,
         "LAlt"  : 1.6,
         "Space" : 6.4,
         "AltGr" : 1.6,
diff --git a/guacamole/src/main/frontend/src/layouts/nl-nl-qwerty.json b/guacamole/src/main/frontend/src/layouts/nl-nl-qwerty.json
index 65f24cb..f1e8744 100644
--- a/guacamole/src/main/frontend/src/layouts/nl-nl-qwerty.json
+++ b/guacamole/src/main/frontend/src/layouts/nl-nl-qwerty.json
@@ -78,7 +78,6 @@
 
         "Menu" : [{
             "title"    : "Menu",
-            "modifier" : "super",
             "keysym"   : 65383
         }],
         "LShift" : [{
@@ -116,10 +115,10 @@
             "modifier" : "alt-gr",
             "keysym"   : 65027
         }],
-        "Super" : [{
-            "title"    : "Super",
-            "modifier" : "super",
-            "keysym"   : 65515
+        "Meta" : [{
+            "title"    : "Meta",
+            "modifier" : "meta",
+            "keysym"   : 65511
         }],
 
         "@" : [
@@ -419,7 +418,7 @@
                     [ "Tab", "q", "w", "e", "r", "t", "y", "u", "i", "o", "p", "¨", "*",   1,  0.6 ],
                     [ "Caps",  "a", "s", "d", "f", "g", "h", "j", "k", "l", "+", "´", "<", "Enter" ],
                     [ "LShift", "]", "z", "x", "c", "v",  "b", "n",  "m", ",", ".", "-",  "RShift" ],
-                    [ "LCtrl", "Super", "LAlt",         "Space",          "AltGr", "Menu", "RCtrl" ]
+                    [ "LCtrl", "Meta", "LAlt",          "Space",          "AltGr", "Menu", "RCtrl" ]
 
                 ],
 
@@ -446,7 +445,7 @@
         "RShift" : 2.2,
 
         "LCtrl" : 1.6,
-        "Super" : 1.6,
+        "Meta" : 1.6,
         "LAlt"  : 1.6,
         "Space" : 6.4,
         "AltGr" : 1.6,
diff --git a/guacamole/src/main/frontend/src/layouts/ru-ru-qwerty.json b/guacamole/src/main/frontend/src/layouts/ru-ru-qwerty.json
index 189dc16..63fa1cf 100644
--- a/guacamole/src/main/frontend/src/layouts/ru-ru-qwerty.json
+++ b/guacamole/src/main/frontend/src/layouts/ru-ru-qwerty.json
@@ -87,10 +87,10 @@
             "modifier" : "alt",
             "keysym"   : 65514
         }],
-        "Super" : [{
-            "title"    : "Super",
-            "modifier" : "super",
-            "keysym"   : 65515
+        "Meta" : [{
+            "title"    : "Meta",
+            "modifier" : "meta",
+            "keysym"   : 65511
         }],
         "Latin" : [{
             "title"    : "Latin",
@@ -499,7 +499,7 @@
                     [ "Tab", "й", "ц", "у", "к", "е", "н", "г", "ш", "щ", "з", "х", "ъ", "\\" ],
                     [ "Caps",  "ф", "ы", "в", "а", "п", "р", "о", "л", "д", "ж", "э", "Enter" ],
                     [ "LShift", "я", "ч", "с", "м",  "и", "т",  "ь", "б", "ю", "/",  "RShift" ],
-                    [ "LCtrl", "Super", "LAlt",       "Space",        "RAlt", "Menu", "RCtrl" ]
+                    [ "LCtrl", "Meta", "LAlt",        "Space",        "RAlt", "Menu", "RCtrl" ]
 
                 ],
 
@@ -526,7 +526,7 @@
         "RShift" : 3.1,
 
         "LCtrl" : 1.6,
-        "Super" : 1.6,
+        "Meta" : 1.6,
         "LAlt"  : 1.6,
         "Space" : 6.1,
         "RAlt"  : 1.6,