XKB: Actions: Don't run certain actions on the core keyboard
Don't run VT switches, terminations, or anything, on the core keyboard: only run actions which affect the keyboard state. If we get an action such as VT switch, just swallow the event.
This commit is contained in:
		
							parent
							
								
									85dd8efac1
								
							
						
					
					
						commit
						320abd7d1d
					
				|  | @ -48,6 +48,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||||
| int | int | ||||||
| XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) | XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) | ||||||
| { | { | ||||||
|  |     if (dev != inputInfo.keyboard) | ||||||
|         xf86ProcessActionEvent(ACTION_TERMINATE, NULL); |         xf86ProcessActionEvent(ACTION_TERMINATE, NULL); | ||||||
|  | 
 | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -41,6 +41,8 @@ THE USE OR PERFORMANCE OF THIS SOFTWARE. | ||||||
| int | int | ||||||
| XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) | XkbDDXTerminateServer(DeviceIntPtr dev,KeyCode key,XkbAction *act) | ||||||
| { | { | ||||||
|  |     if (dev != inputInfo.keyboard) | ||||||
|         GiveUp(1); |         GiveUp(1); | ||||||
|  | 
 | ||||||
|     return 0; |     return 0; | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -561,6 +561,9 @@ _XkbFilterPointerMove(	XkbSrvInfoPtr	xkbi, | ||||||
| int	x,y; | int	x,y; | ||||||
| Bool	accel; | Bool	accel; | ||||||
| 
 | 
 | ||||||
|  |     if (xkbi->device == inputInfo.keyboard) | ||||||
|  |         return 0; | ||||||
|  | 
 | ||||||
|     if (filter->keycode==0) {		/* initial press */ |     if (filter->keycode==0) {		/* initial press */ | ||||||
| 	filter->keycode = keycode; | 	filter->keycode = keycode; | ||||||
| 	filter->active = 1; | 	filter->active = 1; | ||||||
|  | @ -601,6 +604,9 @@ _XkbFilterPointerBtn(	XkbSrvInfoPtr	xkbi, | ||||||
| 			unsigned	keycode, | 			unsigned	keycode, | ||||||
| 			XkbAction *	pAction) | 			XkbAction *	pAction) | ||||||
| { | { | ||||||
|  |     if (xkbi->device == inputInfo.keyboard) | ||||||
|  |         return 0; | ||||||
|  | 
 | ||||||
|     if (filter->keycode==0) {		/* initial press */ |     if (filter->keycode==0) {		/* initial press */ | ||||||
| 	int	button= pAction->btn.button; | 	int	button= pAction->btn.button; | ||||||
| 
 | 
 | ||||||
|  | @ -980,8 +986,11 @@ _XkbFilterSwitchScreen(	XkbSrvInfoPtr	xkbi, | ||||||
| 			unsigned	keycode, | 			unsigned	keycode, | ||||||
| 			XkbAction *	pAction) | 			XkbAction *	pAction) | ||||||
| { | { | ||||||
|     if (filter->keycode==0) {		/* initial press */ |  | ||||||
|     DeviceIntPtr dev = xkbi->device; |     DeviceIntPtr dev = xkbi->device; | ||||||
|  |     if (dev == inputInfo.keyboard) | ||||||
|  |         return 0; | ||||||
|  | 
 | ||||||
|  |     if (filter->keycode==0) {		/* initial press */ | ||||||
| 	filter->keycode = keycode; | 	filter->keycode = keycode; | ||||||
| 	filter->active = 1; | 	filter->active = 1; | ||||||
| 	filter->filterOthers = 0; | 	filter->filterOthers = 0; | ||||||
|  | @ -1003,8 +1012,11 @@ _XkbFilterXF86Private(	XkbSrvInfoPtr	xkbi, | ||||||
| 			unsigned	keycode, | 			unsigned	keycode, | ||||||
| 			XkbAction *	pAction) | 			XkbAction *	pAction) | ||||||
| { | { | ||||||
|     if (filter->keycode==0) {		/* initial press */ |  | ||||||
|     DeviceIntPtr dev = xkbi->device; |     DeviceIntPtr dev = xkbi->device; | ||||||
|  |     if (dev == inputInfo.keyboard) | ||||||
|  |         return 0; | ||||||
|  | 
 | ||||||
|  |     if (filter->keycode==0) {		/* initial press */ | ||||||
| 	filter->keycode = keycode; | 	filter->keycode = keycode; | ||||||
| 	filter->active = 1; | 	filter->active = 1; | ||||||
| 	filter->filterOthers = 0; | 	filter->filterOthers = 0; | ||||||
|  | @ -1029,6 +1041,9 @@ _XkbFilterDeviceBtn(	XkbSrvInfoPtr	xkbi, | ||||||
| DeviceIntPtr	dev; | DeviceIntPtr	dev; | ||||||
| int		button; | int		button; | ||||||
| 
 | 
 | ||||||
|  |     if (dev == inputInfo.keyboard) | ||||||
|  |         return 0; | ||||||
|  | 
 | ||||||
|     if (filter->keycode==0) {		/* initial press */ |     if (filter->keycode==0) {		/* initial press */ | ||||||
| 	dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL); | 	dev= _XkbLookupButtonDevice(pAction->devbtn.device,NULL); | ||||||
| 	if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice())) | 	if ((!dev)||(!dev->public.on)||(&dev->public==LookupPointerDevice())) | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue