From 31081e5dac48f6351c019bc265d082c0540cd63f Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 14 Aug 2014 14:52:15 -0400 Subject: [PATCH] keybindings: Simplify a bit more code --- src/core/keybindings.c | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/src/core/keybindings.c b/src/core/keybindings.c index acbf5ac93..259ed9010 100644 --- a/src/core/keybindings.c +++ b/src/core/keybindings.c @@ -731,20 +731,15 @@ rebuild_special_bindings (MetaDisplay *display) static void ungrab_key_bindings (MetaDisplay *display) { - GSList *tmp; - GSList *windows; + GSList *windows, *l; meta_screen_ungrab_keys (display->screen); windows = meta_display_list_windows (display, META_LIST_DEFAULT); - tmp = windows; - while (tmp != NULL) + for (l = windows; l; l = l->next) { - MetaWindow *w = tmp->data; - + MetaWindow *w = l->data; meta_window_ungrab_keys (w); - - tmp = tmp->next; } g_slist_free (windows); @@ -753,20 +748,15 @@ ungrab_key_bindings (MetaDisplay *display) static void grab_key_bindings (MetaDisplay *display) { - GSList *tmp; - GSList *windows; + GSList *windows, *l; meta_screen_grab_keys (display->screen); windows = meta_display_list_windows (display, META_LIST_DEFAULT); - tmp = windows; - while (tmp != NULL) + for (l = windows; l; l = l->next) { - MetaWindow *w = tmp->data; - + MetaWindow *w = l->data; meta_window_grab_keys (w); - - tmp = tmp->next; } g_slist_free (windows);