touchevents: set the screen pointer after checking the device is enabled

If the device is disabled the sprite is NULL so we get a seg fault
This commit is contained in:
Ignacio Casal Quinteiro 2021-09-07 16:58:10 +02:00
parent b3b81c8c20
commit 1fd5dec11b

View File

@ -1874,7 +1874,7 @@ int
GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
uint16_t type, uint32_t flags, const ValuatorMask *mask_in)
{
ScreenPtr scr = dev->spriteInfo->sprite->hotPhys.pScreen;
ScreenPtr scr;
TouchClassPtr t = dev->touch;
ValuatorClassPtr v = dev->valuator;
DeviceEvent *event;
@ -1989,6 +1989,8 @@ GetTouchEvents(InternalEvent *events, DeviceIntPtr dev, uint32_t ddx_touchid,
if (need_rawevent)
set_raw_valuators(raw, &mask, FALSE, raw->valuators.data);
scr = dev->spriteInfo->sprite->hotPhys.pScreen;
/* Indirect device touch coordinates are not used for cursor positioning.
* They are merely informational, and are provided in device coordinates.
* The device sprite is used for positioning instead, and it is already