xkb: fix XkbSetMap check for the keytypes count
The previous if/else condition resulted in us always setting the key type count to the current number of key types. Split this up correctly. Regression introduced inde940e06f8Fixes #1249 Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> (cherry picked from commitbe16bd8543)
This commit is contained in:
		
							parent
							
								
									49444ce9f7
								
							
						
					
					
						commit
						2c6989f81e
					
				
							
								
								
									
										13
									
								
								xkb/xkb.c
								
								
								
								
							
							
						
						
									
										13
									
								
								xkb/xkb.c
								
								
								
								
							|  | @ -2511,15 +2511,14 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, | ||||||
|         } |         } | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if ((req->present & XkbKeyTypesMask) && |     if (!(req->present & XkbKeyTypesMask)) { | ||||||
|         (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, |  | ||||||
|                         &nTypes, mapWidths, doswap))) { |  | ||||||
|         client->errorValue = nTypes; |  | ||||||
|         return BadValue; |  | ||||||
|     } |  | ||||||
|     else { |  | ||||||
|         nTypes = xkb->map->num_types; |         nTypes = xkb->map->num_types; | ||||||
|     } |     } | ||||||
|  |     else if (!CheckKeyTypes(client, xkb, req, (xkbKeyTypeWireDesc **) &values, | ||||||
|  | 			       &nTypes, mapWidths, doswap)) { | ||||||
|  | 	    client->errorValue = nTypes; | ||||||
|  | 	    return BadValue; | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     /* symsPerKey/mapWidths must be filled regardless of client-side flags */ |     /* symsPerKey/mapWidths must be filled regardless of client-side flags */ | ||||||
|     map = &xkb->map->key_sym_map[xkb->min_key_code]; |     map = &xkb->map->key_sym_map[xkb->min_key_code]; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue