mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-09-14 08:21:02 +03:00
* fix(macos): prevent remote keyboard focus leaks Gate keyboard grabbing on window, tab, lifecycle, and primary focus state. Release grabs on focus loss or minimize and avoid duplicate grab transitions. Signed-off-by: fufesou <linlong1266@gmail.com> * fix: macos, keyboard focus, comments known issue Signed-off-by: fufesou <linlong1266@gmail.com> * fix: macos, keyboard, fullscreen space switch Signed-off-by: fufesou <linlong1266@gmail.com> * fix: macos, keyboard, focus, relative mouse mode Signed-off-by: fufesou <linlong1266@gmail.com> * fix(macOS): preserve local overlay focus during input recovery Prevent fullscreen and relative-mouse focus recovery from reclaiming remote keyboard input while a local chat or dialog overlay owns focus. Signed-off-by: fufesou <linlong1266@gmail.com> * fix: macos, keyboard, comments trade-off Signed-off-by: fufesou <linlong1266@gmail.com> --------- Signed-off-by: fufesou <linlong1266@gmail.com>
25 lines
504 B
Dart
25 lines
504 B
Dart
class MacOSFullScreenFocusRecovery {
|
|
int _generation = 0;
|
|
int? _pendingGeneration;
|
|
|
|
int? get pendingGeneration => _pendingGeneration;
|
|
|
|
int queue() {
|
|
_generation += 1;
|
|
_pendingGeneration = _generation;
|
|
return _generation;
|
|
}
|
|
|
|
void cancel() {
|
|
_pendingGeneration = null;
|
|
}
|
|
|
|
bool isCurrent(int generation) => _pendingGeneration == generation;
|
|
|
|
bool consume(int generation) {
|
|
if (!isCurrent(generation)) return false;
|
|
_pendingGeneration = null;
|
|
return true;
|
|
}
|
|
}
|