mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-01-07 03:10:11 +01:00
Trap Deactivate messages and release modifiers to avoid "stuck shift lock" (etc) bugs
This commit is contained in:
parent
e306e8760f
commit
9cf83386e8
1 changed files with 13 additions and 0 deletions
|
|
@ -143,6 +143,16 @@ static void DarwinUpdateModifiers(
|
|||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* DarwinReleaseModifiers
|
||||
* This hacky function releases all modifier keys. It should be called when X11.app
|
||||
* is deactivated (kXDarwinDeactivate) to prevent modifiers from getting stuck if they
|
||||
* are held down during a "context" switch -- otherwise, we would miss the KeyUp.
|
||||
*/
|
||||
static void DarwinReleaseModifiers(void) {
|
||||
xEvent e;
|
||||
DarwinUpdateModifiers(&e, KeyRelease, COMMAND_MASK(-1) | CONTROL_MASK(-1) | ALTERNATE_MASK(-1) | SHIFT_MASK(-1));
|
||||
}
|
||||
|
||||
/*
|
||||
* DarwinSimulateMouseClick
|
||||
|
|
@ -467,6 +477,9 @@ void ProcessInputEvents(void)
|
|||
break;
|
||||
}
|
||||
|
||||
case kXDarwinDeactivate:
|
||||
DarwinReleaseModifiers();
|
||||
// fall through
|
||||
default:
|
||||
// Check for mode specific event
|
||||
DarwinModeProcessEvent(&xe);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue