(!1893) dix: write out X_GetInputFocus reply directly
No need for using a complex callback machinery, if we just move the little pieces of byte-swapping directly into the request handler. Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									21cb2ca5f5
								
							
						
					
					
						commit
						d52652d5f9
					
				|  | @ -4972,7 +4972,6 @@ int | ||||||
| ProcGetInputFocus(ClientPtr client) | ProcGetInputFocus(ClientPtr client) | ||||||
| { | { | ||||||
|     DeviceIntPtr kbd = PickKeyboard(client); |     DeviceIntPtr kbd = PickKeyboard(client); | ||||||
|     xGetInputFocusReply rep; |  | ||||||
|     FocusClassPtr focus = kbd->focus; |     FocusClassPtr focus = kbd->focus; | ||||||
|     int rc; |     int rc; | ||||||
| 
 | 
 | ||||||
|  | @ -4983,7 +4982,7 @@ ProcGetInputFocus(ClientPtr client) | ||||||
|     if (rc != Success) |     if (rc != Success) | ||||||
|         return rc; |         return rc; | ||||||
| 
 | 
 | ||||||
|     rep = (xGetInputFocusReply) { |     xGetInputFocusReply rep = { | ||||||
|         .type = X_Reply, |         .type = X_Reply, | ||||||
|         .length = 0, |         .length = 0, | ||||||
|         .sequenceNumber = client->sequence, |         .sequenceNumber = client->sequence, | ||||||
|  | @ -4997,7 +4996,11 @@ ProcGetInputFocus(ClientPtr client) | ||||||
|     else |     else | ||||||
|         rep.focus = focus->win->drawable.id; |         rep.focus = focus->win->drawable.id; | ||||||
| 
 | 
 | ||||||
|     WriteReplyToClient(client, sizeof(xGetInputFocusReply), &rep); |     if (client->swapped) { | ||||||
|  |         swaps(&rep.sequenceNumber); | ||||||
|  |         swapl(&rep.focus); | ||||||
|  |     } | ||||||
|  |     WriteToClient(client, sizeof(rep), &rep); | ||||||
|     return Success; |     return Success; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
|  | @ -239,14 +239,6 @@ SwapTimeCoordWrite(ClientPtr pClient, int size, xTimecoord * pRep) | ||||||
| 
 | 
 | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void _X_COLD |  | ||||||
| SGetInputFocusReply(ClientPtr pClient, int size, xGetInputFocusReply * pRep) |  | ||||||
| { |  | ||||||
|     swaps(&pRep->sequenceNumber); |  | ||||||
|     swapl(&pRep->focus); |  | ||||||
|     WriteToClient(pClient, size, pRep); |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| static void _X_COLD | static void _X_COLD | ||||||
| SwapCharInfo(xCharInfo * pInfo) | SwapCharInfo(xCharInfo * pInfo) | ||||||
| { | { | ||||||
|  |  | ||||||
|  | @ -758,7 +758,7 @@ ReplySwapPtr ReplySwapVector[256] = { | ||||||
|     ReplyNotSwappd,                             /* 40 */ |     ReplyNotSwappd,                             /* 40 */ | ||||||
|     ReplyNotSwappd, |     ReplyNotSwappd, | ||||||
|     ReplyNotSwappd, |     ReplyNotSwappd, | ||||||
|     (ReplySwapPtr) SGetInputFocusReply, |     ReplyNotSwappd, | ||||||
|     ReplyNotSwappd, |     ReplyNotSwappd, | ||||||
|     ReplyNotSwappd,                             /* 45 */ |     ReplyNotSwappd,                             /* 45 */ | ||||||
|     ReplyNotSwappd, |     ReplyNotSwappd, | ||||||
|  |  | ||||||
|  | @ -60,10 +60,6 @@ extern void SwapTimeCoordWrite(ClientPtr /* pClient */ , | ||||||
|                                int /* size */ , |                                int /* size */ , | ||||||
|                                xTimecoord * /* pRep */ ); |                                xTimecoord * /* pRep */ ); | ||||||
| 
 | 
 | ||||||
| extern void SGetInputFocusReply(ClientPtr /* pClient */ , |  | ||||||
|                                 int /* size */ , |  | ||||||
|                                 xGetInputFocusReply * /* pRep */ ); |  | ||||||
| 
 |  | ||||||
| extern void SListExtensionsReply(ClientPtr /* pClient */ , | extern void SListExtensionsReply(ClientPtr /* pClient */ , | ||||||
|                                  int /* size */ , |                                  int /* size */ , | ||||||
|                                  xListExtensionsReply * /* pRep */ ); |                                  xListExtensionsReply * /* pRep */ ); | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue