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/getselev.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/getselev.c')
-rw-r--r-- | nx-X11/programs/Xserver/Xi/getselev.c | 124 |
1 files changed, 59 insertions, 65 deletions
diff --git a/nx-X11/programs/Xserver/Xi/getselev.c b/nx-X11/programs/Xserver/Xi/getselev.c index bac74317b..b36b833d3 100644 --- a/nx-X11/programs/Xserver/Xi/getselev.c +++ b/nx-X11/programs/Xserver/Xi/getselev.c @@ -55,14 +55,14 @@ SOFTWARE. #include <dix-config.h> #endif -#include <nx-X11/X.h> /* for inputstr.h */ -#include <nx-X11/Xproto.h> /* Request macro */ +#include <nx-X11/X.h> /* for inputstr.h */ +#include <nx-X11/Xproto.h> /* Request macro */ #include <nx-X11/extensions/XI.h> #include <nx-X11/extensions/XIproto.h> -#include "inputstr.h" /* DeviceIntPtr */ -#include "windowstr.h" /* window struct */ +#include "inputstr.h" /* DeviceIntPtr */ +#include "windowstr.h" /* window struct */ #include "extnsionst.h" -#include "extinit.h" /* LookupDeviceIntRec */ +#include "extinit.h" /* LookupDeviceIntRec */ #include "exglobals.h" #include "swaprep.h" @@ -76,15 +76,14 @@ SOFTWARE. */ int -SProcXGetSelectedExtensionEvents(client) - register ClientPtr client; - { +SProcXGetSelectedExtensionEvents(register ClientPtr client) +{ REQUEST(xGetSelectedExtensionEventsReq); swaps(&stuff->length); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); swapl(&stuff->window); - return(ProcXGetSelectedExtensionEvents(client)); - } + return (ProcXGetSelectedExtensionEvents(client)); +} /*********************************************************************** * @@ -94,18 +93,17 @@ SProcXGetSelectedExtensionEvents(client) */ int -ProcXGetSelectedExtensionEvents(client) - register ClientPtr client; - { - int i; - int total_length = 0; - xGetSelectedExtensionEventsReply rep; - WindowPtr pWin; - XEventClass *buf = NULL; - XEventClass *tclient; - XEventClass *aclient; - OtherInputMasks *pOthers; - InputClientsPtr others; +ProcXGetSelectedExtensionEvents(register ClientPtr client) +{ + int i; + int total_length = 0; + xGetSelectedExtensionEventsReply rep; + WindowPtr pWin; + XEventClass *buf = NULL; + XEventClass *tclient; + XEventClass *aclient; + OtherInputMasks *pOthers; + InputClientsPtr others; REQUEST(xGetSelectedExtensionEventsReq); REQUEST_SIZE_MATCH(xGetSelectedExtensionEventsReq); @@ -117,55 +115,53 @@ ProcXGetSelectedExtensionEvents(client) rep.this_client_count = 0; rep.all_clients_count = 0; - if (!(pWin = LookupWindow(stuff->window, client))) - { - SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0, - BadWindow); + if (!(pWin = LookupWindow(stuff->window, client))) { + SendErrorToClient(client, IReqCode, X_GetSelectedExtensionEvents, 0, + BadWindow); return Success; - } - - if ((pOthers = wOtherInputMasks(pWin)) != 0) - { - for (others = pOthers->inputClients; others; others=others->next) - for (i=0; i<EMASKSIZE; i++) - tclient = ClassFromMask (NULL, others->mask[i], i, - &rep.all_clients_count, COUNT); - - for (others = pOthers->inputClients; others; others=others->next) - if (SameClient(others, client)) - { - for (i=0; i<EMASKSIZE; i++) - tclient = ClassFromMask (NULL, others->mask[i], i, - &rep.this_client_count, COUNT); + } + + if ((pOthers = wOtherInputMasks(pWin)) != 0) { + for (others = pOthers->inputClients; others; others = others->next) + for (i = 0; i < EMASKSIZE; i++) + tclient = ClassFromMask(NULL, others->mask[i], i, + &rep.all_clients_count, COUNT); + + for (others = pOthers->inputClients; others; others = others->next) + if (SameClient(others, client)) { + for (i = 0; i < EMASKSIZE; i++) + tclient = ClassFromMask(NULL, others->mask[i], i, + &rep.this_client_count, COUNT); break; - } + } - total_length = (rep.all_clients_count + rep.this_client_count) * - sizeof (XEventClass); + total_length = (rep.all_clients_count + rep.this_client_count) * + sizeof(XEventClass); rep.length = (total_length + 3) >> 2; - buf = (XEventClass *) malloc (total_length); + buf = (XEventClass *) malloc(total_length); tclient = buf; aclient = buf + rep.this_client_count; if (others) - for (i=0; i<EMASKSIZE; i++) - tclient = ClassFromMask (tclient, others->mask[i], i, NULL, CREATE); - - for (others = pOthers->inputClients; others; others=others->next) - for (i=0; i<EMASKSIZE; i++) - aclient = ClassFromMask (aclient, others->mask[i], i, NULL, CREATE); - } + for (i = 0; i < EMASKSIZE; i++) + tclient = + ClassFromMask(tclient, others->mask[i], i, NULL, CREATE); + + for (others = pOthers->inputClients; others; others = others->next) + for (i = 0; i < EMASKSIZE; i++) + aclient = + ClassFromMask(aclient, others->mask[i], i, NULL, CREATE); + } - WriteReplyToClient (client, sizeof(xGetSelectedExtensionEventsReply), &rep); + WriteReplyToClient(client, sizeof(xGetSelectedExtensionEventsReply), &rep); - if (total_length) - { + if (total_length) { client->pSwapReplyFunc = (ReplySwapPtr) Swap32Write; - WriteSwappedDataToClient( client, total_length, buf); - free (buf); - } - return Success; + WriteSwappedDataToClient(client, total_length, buf); + free(buf); } + return Success; +} /*********************************************************************** * @@ -175,14 +171,12 @@ ProcXGetSelectedExtensionEvents(client) */ void -SRepXGetSelectedExtensionEvents (client, size, rep) - ClientPtr client; - int size; - xGetSelectedExtensionEventsReply *rep; - { +SRepXGetSelectedExtensionEvents(ClientPtr client, int size, + xGetSelectedExtensionEventsReply * rep) +{ swaps(&rep->sequenceNumber); swapl(&rep->length); swaps(&rep->this_client_count); swaps(&rep->all_clients_count); WriteToClient(client, size, rep); - } +} |