dix: add AllocGrab helper function
Not needed since the GrabRec is a self-contained struct but will be needed for the xi2 input mask rework. FreeGrab already exists, make it available to other callers. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Chase Douglas <chase.douglas@canonical.com>
This commit is contained in:
parent
7af23259d8
commit
347f377f3b
12
dix/grabs.c
12
dix/grabs.c
|
@ -180,6 +180,14 @@ UngrabAllDevices(Bool kill_client)
|
||||||
ErrorF("End list of ungrabbed devices\n");
|
ErrorF("End list of ungrabbed devices\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
GrabPtr
|
||||||
|
AllocGrab(void)
|
||||||
|
{
|
||||||
|
GrabPtr grab = calloc(1, sizeof(GrabRec));
|
||||||
|
|
||||||
|
return grab;
|
||||||
|
}
|
||||||
|
|
||||||
GrabPtr
|
GrabPtr
|
||||||
CreateGrab(
|
CreateGrab(
|
||||||
int client,
|
int client,
|
||||||
|
@ -196,7 +204,7 @@ CreateGrab(
|
||||||
{
|
{
|
||||||
GrabPtr grab;
|
GrabPtr grab;
|
||||||
|
|
||||||
grab = calloc(1, sizeof(GrabRec));
|
grab = AllocGrab();
|
||||||
if (!grab)
|
if (!grab)
|
||||||
return (GrabPtr)NULL;
|
return (GrabPtr)NULL;
|
||||||
grab->resource = FakeClientID(client);
|
grab->resource = FakeClientID(client);
|
||||||
|
@ -226,7 +234,7 @@ CreateGrab(
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
void
|
||||||
FreeGrab(GrabPtr pGrab)
|
FreeGrab(GrabPtr pGrab)
|
||||||
{
|
{
|
||||||
free(pGrab->modifiersDetail.pMask);
|
free(pGrab->modifiersDetail.pMask);
|
||||||
|
|
|
@ -31,6 +31,9 @@ struct _GrabParameters;
|
||||||
extern void PrintDeviceGrabInfo(DeviceIntPtr dev);
|
extern void PrintDeviceGrabInfo(DeviceIntPtr dev);
|
||||||
extern void UngrabAllDevices(Bool kill_client);
|
extern void UngrabAllDevices(Bool kill_client);
|
||||||
|
|
||||||
|
extern GrabPtr AllocGrab(void);
|
||||||
|
extern void FreeGrab(GrabPtr grab);
|
||||||
|
|
||||||
extern GrabPtr CreateGrab(
|
extern GrabPtr CreateGrab(
|
||||||
int /* client */,
|
int /* client */,
|
||||||
DeviceIntPtr /* device */,
|
DeviceIntPtr /* device */,
|
||||||
|
|
Loading…
Reference in New Issue