(!1654) Xnest: replace XGetKeyboardControl() by xcb_get_keyboard_control()
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
		
							parent
							
								
									845f43d7bd
								
							
						
					
					
						commit
						404f7e9130
					
				|  | @ -98,7 +98,6 @@ int | ||||||
| xnestKeyboardProc(DeviceIntPtr pDev, int onoff) | xnestKeyboardProc(DeviceIntPtr pDev, int onoff) | ||||||
| { | { | ||||||
|     int i, j; |     int i, j; | ||||||
|     XKeyboardState values; |  | ||||||
| 
 | 
 | ||||||
|     switch (onoff) { |     switch (onoff) { | ||||||
|     case DEVICE_INIT: |     case DEVICE_INIT: | ||||||
|  | @ -241,9 +240,26 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) | ||||||
|     return Success; |     return Success; | ||||||
| 
 | 
 | ||||||
| XkbError: | XkbError: | ||||||
|     XGetKeyboardControl(xnestDisplay, &values); |     { | ||||||
|     memmove((char *) defaultKeyboardControl.autoRepeats, |         xcb_generic_error_t *ctrl_err = NULL; | ||||||
|             (char *) values.auto_repeats, sizeof(values.auto_repeats)); |         xcb_get_keyboard_control_reply_t *ctrl_reply = | ||||||
|  |             xcb_get_keyboard_control_reply(xnestUpstreamInfo.conn, | ||||||
|  |                                            xcb_get_keyboard_control(xnestUpstreamInfo.conn), | ||||||
|  |                                            &ctrl_err); | ||||||
|  |         if (ctrl_err) { | ||||||
|  |             ErrorF("failed retrieving keyboard control: %d\n", ctrl_err->error_code); | ||||||
|  |             free(ctrl_err); | ||||||
|  |         } | ||||||
|  |         else if (!ctrl_reply) { | ||||||
|  |             ErrorF("failed retrieving keyboard control: no reply\n"); | ||||||
|  |         } | ||||||
|  |         else { | ||||||
|  |             memcpy(defaultKeyboardControl.autoRepeats, | ||||||
|  |                    ctrl_reply->auto_repeats, | ||||||
|  |                    sizeof(ctrl_reply->auto_repeats)); | ||||||
|  |             free(ctrl_reply); | ||||||
|  |         } | ||||||
|  |     } | ||||||
| 
 | 
 | ||||||
|     InitKeyboardDeviceStruct(pDev, NULL, xnestBell, xnestChangeKeyboardControl); |     InitKeyboardDeviceStruct(pDev, NULL, xnestBell, xnestChangeKeyboardControl); | ||||||
|     return Success; |     return Success; | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue