mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-05-11 02:16:00 +02:00
main window add block mask, cm add keyboard block (#8640)
* block window body only so user can still click minisize button. * cm doesn't show mask * Remove focusable Offstage in tabbar_widget.dart Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
parent
eb5ab4d7d9
commit
af66d2a73b
4 changed files with 162 additions and 135 deletions
|
@ -2715,20 +2715,26 @@ Future<void> shouldBeBlocked(RxBool block, WhetherUseRemoteBlock? use) async {
|
|||
}
|
||||
|
||||
typedef WhetherUseRemoteBlock = Future<bool> Function();
|
||||
Widget buildRemoteBlock({required Widget child, WhetherUseRemoteBlock? use}) {
|
||||
var block = false.obs;
|
||||
Widget buildRemoteBlock(
|
||||
{required Widget child,
|
||||
required RxBool block,
|
||||
required bool mask,
|
||||
WhetherUseRemoteBlock? use}) {
|
||||
return Obx(() => MouseRegion(
|
||||
onEnter: (_) async {
|
||||
await shouldBeBlocked(block, use);
|
||||
},
|
||||
onExit: (event) => block.value = false,
|
||||
child: Stack(children: [
|
||||
child,
|
||||
Offstage(
|
||||
offstage: !block.value,
|
||||
child: Container(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
)),
|
||||
// scope block tab
|
||||
FocusScope(child: child, canRequestFocus: !block.value),
|
||||
// mask block click, cm not block click and still use check_click_time to avoid block local click
|
||||
if (mask)
|
||||
Offstage(
|
||||
offstage: !block.value,
|
||||
child: Container(
|
||||
color: Colors.black.withOpacity(0.5),
|
||||
)),
|
||||
]),
|
||||
));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue