@@ -114,7 +114,6 @@ static void focus_view(struct tinywl_view *view, struct wlr_surface *surface) {
114114 seat -> keyboard_state .focused_surface );
115115 wlr_xdg_toplevel_set_activated (previous , false);
116116 }
117- struct wlr_keyboard * keyboard = wlr_seat_get_keyboard (seat );
118117 /* Move the view to the front */
119118 wl_list_remove (& view -> link );
120119 wl_list_insert (& server -> views , & view -> link );
@@ -125,8 +124,13 @@ static void focus_view(struct tinywl_view *view, struct wlr_surface *surface) {
125124 * track of this and automatically send key events to the appropriate
126125 * clients without additional work on your part.
127126 */
128- wlr_seat_keyboard_notify_enter (seat , view -> xdg_surface -> surface ,
129- keyboard -> keycodes , keyboard -> num_keycodes , & keyboard -> modifiers );
127+ struct wlr_keyboard * keyboard = wlr_seat_get_keyboard (seat );
128+ if (keyboard != NULL ) {
129+ wlr_seat_keyboard_notify_enter (seat , view -> xdg_surface -> surface ,
130+ keyboard -> keycodes , keyboard -> num_keycodes , & keyboard -> modifiers );
131+ } else {
132+ wlr_seat_keyboard_notify_enter (seat , surface , NULL , 0 , NULL );
133+ }
130134}
131135
132136static void keyboard_handle_modifiers (
0 commit comments