mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-20 15:10:02 +01:00
mi: don't crash on miPointerGetPosition for disabled devices
If a device is disabled, its master device is forcibly reset to NULL but
unlike a floating device it doesn't have a sprite allocated. Calling
miPointerGetPosition for a disabled device thus crashes.
Avoid this by returning 0/0 for any device without a miPointer.
This is a quick fix only, a proper fix for this issue is rather more
involved.
Closes #1782
(cherry picked from commit acbdd0ecdd)
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1895>
This commit is contained in:
parent
5b1d9da00f
commit
6d33c347ea
1 changed files with 9 additions and 2 deletions
|
|
@ -718,8 +718,15 @@ miPointerSetPosition(DeviceIntPtr pDev, int mode, double *screenx,
|
||||||
void
|
void
|
||||||
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
miPointerGetPosition(DeviceIntPtr pDev, int *x, int *y)
|
||||||
{
|
{
|
||||||
*x = MIPOINTER(pDev)->x;
|
miPointerPtr pPointer = MIPOINTER(pDev);
|
||||||
*y = MIPOINTER(pDev)->y;
|
if (pPointer) {
|
||||||
|
*x = pPointer->x;
|
||||||
|
*y = pPointer->y;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
*x = 0;
|
||||||
|
*y = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue