(!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) | ||||
| { | ||||
|     int i, j; | ||||
|     XKeyboardState values; | ||||
| 
 | ||||
|     switch (onoff) { | ||||
|     case DEVICE_INIT: | ||||
|  | @ -240,10 +239,27 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) | |||
|     } | ||||
|     return Success; | ||||
| 
 | ||||
|  XkbError: | ||||
|     XGetKeyboardControl(xnestDisplay, &values); | ||||
|     memmove((char *) defaultKeyboardControl.autoRepeats, | ||||
|             (char *) values.auto_repeats, sizeof(values.auto_repeats)); | ||||
| XkbError: | ||||
|     { | ||||
|         xcb_generic_error_t *ctrl_err = NULL; | ||||
|         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); | ||||
|     return Success; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue