diff options
author | Mihai Moldovan <ionic@ionic.de> | 2018-02-26 01:00:54 +0100 |
---|---|---|
committer | Mihai Moldovan <ionic@ionic.de> | 2018-02-26 01:00:54 +0100 |
commit | 05152b788ab184f45df1f64182791c88a09dc6f9 (patch) | |
tree | 4232012c65ee251fef529950a420689154778847 /nx-X11/programs/Xserver/Xi/closedev.c | |
parent | e247900edd20c140faf42ba0759bf59cbd2f75ae (diff) | |
parent | 4598c0c3d215f7f2237a9ccee3a143025f2af005 (diff) | |
download | nx-libs-05152b788ab184f45df1f64182791c88a09dc6f9.tar.gz nx-libs-05152b788ab184f45df1f64182791c88a09dc6f9.tar.bz2 nx-libs-05152b788ab184f45df1f64182791c88a09dc6f9.zip |
Merge branch 'uli42-pr/update_xi' into arctica-3.6.x
Attributes GH PR #644: https://github.com/ArcticaProject/nx-libs/pull/644
Diffstat (limited to 'nx-X11/programs/Xserver/Xi/closedev.c')
-rw-r--r-- | nx-X11/programs/Xserver/Xi/closedev.c | 101 |
1 files changed, 44 insertions, 57 deletions
diff --git a/nx-X11/programs/Xserver/Xi/closedev.c b/nx-X11/programs/Xserver/Xi/closedev.c index 2ba90d0d1..b41474e70 100644 --- a/nx-X11/programs/Xserver/Xi/closedev.c +++ b/nx-X11/programs/Xserver/Xi/closedev.c @@ -55,16 +55,16 @@ SOFTWARE. #include <dix-config.h> #endif -#include <nx-X11/X.h> /* for inputstr.h */ -#include <nx-X11/Xproto.h> /* Request macro */ -#include "inputstr.h" /* DeviceIntPtr */ -#include "windowstr.h" /* window structure */ -#include "scrnintstr.h" /* screen structure */ +#include <nx-X11/X.h> /* for inputstr.h */ +#include <nx-X11/Xproto.h> /* Request macro */ +#include "inputstr.h" /* DeviceIntPtr */ +#include "windowstr.h" /* window structure */ +#include "scrnintstr.h" /* screen structure */ #include <nx-X11/extensions/XI.h> #include <nx-X11/extensions/XIproto.h> #include "XIstubs.h" #include "extnsionst.h" -#include "extinit.h" /* LookupDeviceIntRec */ +#include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "closedev.h" @@ -76,14 +76,13 @@ SOFTWARE. */ int -SProcXCloseDevice(client) - register ClientPtr client; - { +SProcXCloseDevice(register ClientPtr client) +{ REQUEST(xCloseDeviceReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xCloseDeviceReq); - return(ProcXCloseDevice(client)); - } + return (ProcXCloseDevice(client)); +} /*********************************************************************** * @@ -92,41 +91,38 @@ SProcXCloseDevice(client) */ int -ProcXCloseDevice(client) - register ClientPtr client; - { - int i; - WindowPtr pWin, p1; - DeviceIntPtr d; +ProcXCloseDevice(register ClientPtr client) +{ + int i; + WindowPtr pWin, p1; + DeviceIntPtr d; REQUEST(xCloseDeviceReq); REQUEST_SIZE_MATCH(xCloseDeviceReq); - d = LookupDeviceIntRec (stuff->deviceid); - if (d == NULL) - { + d = LookupDeviceIntRec(stuff->deviceid); + if (d == NULL) { SendErrorToClient(client, IReqCode, X_CloseDevice, 0, BadDevice); - return Success; - } + return Success; + } if (d->grab && SameClient(d->grab, client)) - (*d->DeactivateGrab)(d); /* release active grab */ + (*d->DeactivateGrab) (d); /* release active grab */ /* Remove event selections from all windows for events from this device - and selected by this client. - Delete passive grabs from all windows for this device. */ + * and selected by this client. + * Delete passive grabs from all windows for this device. */ - for (i=0; i<screenInfo.numScreens; i++) - { + for (i = 0; i < screenInfo.numScreens; i++) { pWin = screenInfo.screens[i]->root; - DeleteDeviceEvents (d, pWin, client); + DeleteDeviceEvents(d, pWin, client); p1 = pWin->firstChild; - DeleteEventsFromChildren (d, p1, client); - } + DeleteEventsFromChildren(d, p1, client); + } - CloseInputDevice (d, client); + CloseInputDevice(d, client); return Success; - } +} /*********************************************************************** * @@ -136,21 +132,17 @@ ProcXCloseDevice(client) */ void -DeleteEventsFromChildren(dev, p1, client) - DeviceIntPtr dev; - WindowPtr p1; - ClientPtr client; - { +DeleteEventsFromChildren(DeviceIntPtr dev, WindowPtr p1, ClientPtr client) +{ WindowPtr p2; - while (p1) - { - p2 = p1->firstChild; - DeleteDeviceEvents (dev, p1, client); + while (p1) { + p2 = p1->firstChild; + DeleteDeviceEvents(dev, p1, client); DeleteEventsFromChildren(dev, p2, client); p1 = p1->nextSib; - } } +} /*********************************************************************** * @@ -160,26 +152,21 @@ DeleteEventsFromChildren(dev, p1, client) */ void -DeleteDeviceEvents (dev, pWin, client) - DeviceIntPtr dev; - WindowPtr pWin; - ClientPtr client; - { - InputClientsPtr others; - OtherInputMasks *pOthers; - GrabPtr grab, next; +DeleteDeviceEvents(DeviceIntPtr dev, WindowPtr pWin, ClientPtr client) +{ + InputClientsPtr others; + OtherInputMasks *pOthers; + GrabPtr grab, next; if ((pOthers = wOtherInputMasks(pWin)) != 0) - for (others=pOthers->inputClients; others; - others = others->next) - if (SameClient(others,client)) + for (others = pOthers->inputClients; others; others = others->next) + if (SameClient(others, client)) others->mask[dev->id] = NoEventMask; - for (grab = wPassiveGrabs(pWin); grab; grab=next) - { + for (grab = wPassiveGrabs(pWin); grab; grab = next) { next = grab->next; if ((grab->device == dev) && (client->clientAsMask == CLIENT_BITS(grab->resource))) - FreeResource (grab->resource, RT_NONE); - } + FreeResource(grab->resource, RT_NONE); } +} |