]> Pileus Git - ~andy/gtk/blobdiff - gtk/gtkaccelgroup.c
filechooserbutton: Duh, remove all the timeouts after tests
[~andy/gtk] / gtk / gtkaccelgroup.c
index f089336552edb8215aded47edb4cfe777590222b..c2d91028fd68a9b55802b3c84dbe4a24c53a7ee3 100644 (file)
@@ -12,9 +12,7 @@
  * Lesser General Public License for more details.
  *
  * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
  */
 
 /*
@@ -151,7 +149,7 @@ gtk_accel_group_class_init (GtkAccelGroupClass *class)
    * @modifier: the modifier combination of the accelerator
    * @accel_closure: the #GClosure of the accelerator
    *
-   * The accel-changed signal is emitted when a #GtkAccelGroupEntry
+   * The accel-changed signal is emitted when an entry
    * is added to or removed from the accel group.
    *
    * Widgets like #GtkAccelLabel which display an associated
@@ -1380,14 +1378,24 @@ gtk_accelerator_parse_with_keycode (const gchar     *accelerator,
                 {
                   *accelerator_codes = g_new0 (guint, n_keys + 1);
 
-                  /* Prefer level-0 keys to modified keys */
+                  /* Prefer level-0 group-0 keys to modified keys */
                   for (i = 0, j = 0; i < n_keys; ++i)
                     {
-                      if (keys[i].level == 0)
+                      if (keys[i].level == 0 && keys[i].group == 0)
                         (*accelerator_codes)[j++] = keys[i].keycode;
                     }
 
-                  /* No level-0 keys? Find in the whole keymap */
+                  /* No level-0 group-0 keys? Find in the whole group-0 */
+                  if (j == 0)
+                    {
+                      for (i = 0, j = 0; i < n_keys; ++i)
+                        {
+                          if (keys[i].group == 0)
+                            (*accelerator_codes)[j++] = keys[i].keycode;
+                        }
+                    }
+
+                  /* Still nothing? Try in other groups */
                   if (j == 0)
                     {
                       for (i = 0, j = 0; i < n_keys; ++i)
@@ -1454,6 +1462,7 @@ gtk_accelerator_parse (const gchar     *accelerator,
  * gtk_accelerator_name_with_keycode:
  * @display: (allow-none): a #GdkDisplay or %NULL to use the default display
  * @accelerator_key: accelerator keyval
+ * @keycode: accelerator keycode
  * @accelerator_mods: accelerator modifier mask
  *
  * Converts an accelerator keyval and modifier mask
@@ -1639,6 +1648,7 @@ gtk_accelerator_name (guint           accelerator_key,
  * gtk_accelerator_get_label_with_keycode:
  * @display: (allow-none): a #GdkDisplay or %NULL to use the default display
  * @accelerator_key: accelerator keyval
+ * @keycode: accelerator keycode
  * @accelerator_mods: accelerator modifier mask
  *
  * Converts an accelerator keyval and modifier mask