keybindings: Reduce variable scope

We can't remove the variable entirely because g_array_append_val()
is a macro that assumes a variable as parameter.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/4050>
This commit is contained in:
Alessandro Bono
2024-09-26 01:14:49 +02:00
committed by Marge Bot
parent db81ba4d5b
commit be819d9983

View File

@ -387,14 +387,13 @@ get_keycodes_for_keysym (MetaKeyBindingManager *keys,
{ {
unsigned int i; unsigned int i;
GArray *keycodes; GArray *keycodes;
int keycode;
keycodes = g_array_new (FALSE, FALSE, sizeof (xkb_keysym_t)); keycodes = g_array_new (FALSE, FALSE, sizeof (xkb_keysym_t));
/* Special-case: Fake mutter keysym */ /* Special-case: Fake mutter keysym */
if (keysym == META_KEY_ABOVE_TAB) if (keysym == META_KEY_ABOVE_TAB)
{ {
keycode = KEY_GRAVE + 8; int keycode = KEY_GRAVE + 8;
g_array_append_val (keycodes, keycode); g_array_append_val (keycodes, keycode);
goto out; goto out;
} }