commit 5ef6e78
Michael Forney
·
2014-02-17 09:38:24 +0000 UTC
parent acdd686
Style
3 files changed,
+6,
-6
+2,
-2
1@@ -204,8 +204,8 @@ void keyboard_handle_key(struct keyboard * keyboard, uint32_t time,
2 {
3 if (handler->key && handler->key(keyboard, time, key, state))
4 {
5- if (state == WL_KEYBOARD_KEY_STATE_PRESSED)
6- *((uint32_t *) wl_array_add(&handler->keys, sizeof key)) = key;
7+ pressed_key = wl_array_add(&handler->keys, sizeof *pressed_key);
8+ *pressed_key = key;
9 break;
10 }
11 }
+1,
-1
1@@ -372,7 +372,7 @@ bool swc_seat_initialize(const char * seat_name)
2 }
3
4 seat.global = wl_global_create(swc.display, &wl_seat_interface, 2,
5- NULL, &bind_seat);
6+ NULL, &bind_seat);
7
8 if (!seat.global)
9 goto error1;
+3,
-3
1@@ -71,7 +71,7 @@ EXPORT
2 void swc_window_focus(struct swc_window * base)
3 {
4 struct window * window = INTERNAL(base);
5- struct swc_surface * new_focus = window ? INTERNAL(window)->surface : NULL,
6+ struct swc_surface * new_focus = window ? window->surface : NULL,
7 * old_focus = swc.seat->keyboard->focus.surface;
8
9 /* If the keyboard already has a focused window, and we are changing the
10@@ -79,9 +79,9 @@ void swc_window_focus(struct swc_window * base)
11 * the focus of the previous focus window's implementation to NULL. */
12 if (old_focus && old_focus->window
13 && !(window && window->impl == INTERNAL(old_focus->window)->impl)
14- && INTERNAL(old_focus->window)->impl->focus)
15+ && old_focus->window->impl->focus)
16 {
17- INTERNAL(old_focus->window)->impl->focus(NULL);
18+ old_focus->window->impl->focus(NULL);
19 }
20
21 if (window && window->impl->focus)