This repository was archived by the owner on Nov 1, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -94,11 +94,12 @@ struct tinywl_keyboard {
94
94
95
95
static void focus_view (struct tinywl_view * view , struct wlr_surface * surface ) {
96
96
/* Note: this function only deals with keyboard focus. */
97
- if (view == NULL ) {
98
- return ;
99
- }
100
97
struct tinywl_server * server = view -> server ;
101
98
struct wlr_seat * seat = server -> seat ;
99
+ struct wlr_keyboard * keyboard = wlr_seat_get_keyboard (seat );
100
+ if (view == NULL || keyboard == NULL ) {
101
+ return ;
102
+ }
102
103
struct wlr_surface * prev_surface = seat -> keyboard_state .focused_surface ;
103
104
if (prev_surface == surface ) {
104
105
/* Don't re-focus an already focused surface. */
@@ -114,7 +115,6 @@ static void focus_view(struct tinywl_view *view, struct wlr_surface *surface) {
114
115
seat -> keyboard_state .focused_surface );
115
116
wlr_xdg_toplevel_set_activated (previous , false);
116
117
}
117
- struct wlr_keyboard * keyboard = wlr_seat_get_keyboard (seat );
118
118
/* Move the view to the front */
119
119
wl_list_remove (& view -> link );
120
120
wl_list_insert (& server -> views , & view -> link );
You can’t perform that action at this time.
0 commit comments