@@ -118,7 +118,8 @@ void accesskit_sdl_adapter_update(const struct accesskit_sdl_adapter *adapter,
118
118
accesskit_macos_queued_events_raise (events );
119
119
}
120
120
#elif defined(UNIX )
121
- accesskit_unix_adapter_update (adapter -> adapter , update );
121
+ if (adapter -> adapter != NULL )
122
+ accesskit_unix_adapter_update (adapter -> adapter , update );
122
123
#elif defined(_WIN32 )
123
124
accesskit_windows_queued_events * events =
124
125
accesskit_windows_subclassing_adapter_update (adapter -> adapter , update );
@@ -140,8 +141,10 @@ void accesskit_sdl_adapter_update_if_active(
140
141
accesskit_macos_queued_events_raise (events );
141
142
}
142
143
#elif defined(UNIX )
143
- accesskit_unix_adapter_update (adapter -> adapter ,
144
- update_factory (update_factory_userdata ));
144
+ if (adapter -> adapter != NULL ) {
145
+ accesskit_unix_adapter_update (adapter -> adapter ,
146
+ update_factory (update_factory_userdata ));
147
+ }
145
148
#elif defined(_WIN32 )
146
149
accesskit_windows_queued_events * events =
147
150
accesskit_windows_subclassing_adapter_update_if_active (
@@ -155,16 +158,18 @@ void accesskit_sdl_adapter_update_if_active(
155
158
void accesskit_sdl_adapter_update_root_window_bounds (
156
159
const struct accesskit_sdl_adapter * adapter , SDL_Window * window ) {
157
160
#if defined(UNIX )
158
- int x , y , width , height ;
159
- SDL_GetWindowPosition (window , & x , & y );
160
- SDL_GetWindowSize (window , & width , & height );
161
- int top , left , bottom , right ;
162
- SDL_GetWindowBordersSize (window , & top , & left , & bottom , & right );
163
- accesskit_rect outer_bounds = {x - left , y - top , x + width + right ,
164
- y + height + bottom };
165
- accesskit_rect inner_bounds = {x , y , x + width , y + height };
166
- accesskit_unix_adapter_set_root_window_bounds (adapter -> adapter , outer_bounds ,
167
- inner_bounds );
161
+ if (adapter -> adapter != NULL ) {
162
+ int x , y , width , height ;
163
+ SDL_GetWindowPosition (window , & x , & y );
164
+ SDL_GetWindowSize (window , & width , & height );
165
+ int top , left , bottom , right ;
166
+ SDL_GetWindowBordersSize (window , & top , & left , & bottom , & right );
167
+ accesskit_rect outer_bounds = {x - left , y - top , x + width + right ,
168
+ y + height + bottom };
169
+ accesskit_rect inner_bounds = {x , y , x + width , y + height };
170
+ accesskit_unix_adapter_set_root_window_bounds (adapter -> adapter ,
171
+ outer_bounds , inner_bounds );
172
+ }
168
173
#endif
169
174
}
170
175
0 commit comments