@@ -331,11 +331,21 @@ ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial)
331
331
switch (rc ) {
332
332
case SDL_HITTEST_DRAGGABLE :
333
333
if (input -> display -> shell .xdg ) {
334
- xdg_toplevel_move (window_data -> shell_surface .xdg .roleobj .toplevel , input -> seat , serial );
334
+ if (window_data -> shell_surface .xdg .roleobj .toplevel ) {
335
+ xdg_toplevel_move (window_data -> shell_surface .xdg .roleobj .toplevel ,
336
+ input -> seat ,
337
+ serial );
338
+ }
335
339
} else if (input -> display -> shell .zxdg ) {
336
- zxdg_toplevel_v6_move (window_data -> shell_surface .zxdg .roleobj .toplevel , input -> seat , serial );
340
+ if (window_data -> shell_surface .zxdg .roleobj .toplevel ) {
341
+ zxdg_toplevel_v6_move (window_data -> shell_surface .zxdg .roleobj .toplevel ,
342
+ input -> seat ,
343
+ serial );
344
+ }
337
345
} else {
338
- wl_shell_surface_move (window_data -> shell_surface .wl , input -> seat , serial );
346
+ if (window_data -> shell_surface .wl ) {
347
+ wl_shell_surface_move (window_data -> shell_surface .wl , input -> seat , serial );
348
+ }
339
349
}
340
350
return SDL_TRUE ;
341
351
@@ -348,11 +358,23 @@ ProcessHitTest(struct SDL_WaylandInput *input, uint32_t serial)
348
358
case SDL_HITTEST_RESIZE_BOTTOMLEFT :
349
359
case SDL_HITTEST_RESIZE_LEFT :
350
360
if (input -> display -> shell .xdg ) {
351
- xdg_toplevel_resize (window_data -> shell_surface .xdg .roleobj .toplevel , input -> seat , serial , directions_zxdg [rc - SDL_HITTEST_RESIZE_TOPLEFT ]);
361
+ if (window_data -> shell_surface .xdg .roleobj .toplevel ) {
362
+ xdg_toplevel_resize (window_data -> shell_surface .xdg .roleobj .toplevel ,
363
+ input -> seat ,
364
+ serial ,
365
+ directions_zxdg [rc - SDL_HITTEST_RESIZE_TOPLEFT ]);
366
+ }
352
367
} else if (input -> display -> shell .zxdg ) {
353
- zxdg_toplevel_v6_resize (window_data -> shell_surface .zxdg .roleobj .toplevel , input -> seat , serial , directions_zxdg [rc - SDL_HITTEST_RESIZE_TOPLEFT ]);
368
+ if (window_data -> shell_surface .zxdg .roleobj .toplevel ) {
369
+ zxdg_toplevel_v6_resize (window_data -> shell_surface .zxdg .roleobj .toplevel ,
370
+ input -> seat ,
371
+ serial ,
372
+ directions_zxdg [rc - SDL_HITTEST_RESIZE_TOPLEFT ]);
373
+ }
354
374
} else {
355
- wl_shell_surface_resize (window_data -> shell_surface .wl , input -> seat , serial , directions_wl [rc - SDL_HITTEST_RESIZE_TOPLEFT ]);
375
+ if (window_data -> shell_surface .wl ) {
376
+ wl_shell_surface_resize (window_data -> shell_surface .wl , input -> seat , serial , directions_wl [rc - SDL_HITTEST_RESIZE_TOPLEFT ]);
377
+ }
356
378
}
357
379
return SDL_TRUE ;
358
380
0 commit comments