fix, enable menu before image

Signed-off-by: fufesou <shuanglongchen@yeah.net>
This commit is contained in:
fufesou 2023-08-23 23:29:15 +08:00
parent 535405521c
commit dade589075
3 changed files with 52 additions and 37 deletions

View File

@ -228,15 +228,28 @@ class _RemotePageState extends State<RemotePage>
removeSharedStates(widget.id); removeSharedStates(widget.id);
} }
Widget emptyOverlay() => GestureDetector(
behavior: HitTestBehavior.translucent,
onTap: () {
bind.sessionInputOsPassword(sessionId: sessionId, value: '');
},
child: BlockableOverlay(
state: _blockableOverlayState,
underlying: Container(
color: Colors.transparent,
),
),
);
Widget buildBody(BuildContext context) { Widget buildBody(BuildContext context) {
return Scaffold( return Scaffold(
backgroundColor: Theme.of(context).colorScheme.background, backgroundColor: Theme.of(context).colorScheme.background,
/// the Overlay key will be set with _blockableOverlayState in BlockableOverlay /// the Overlay key will be set with _blockableOverlayState in BlockableOverlay
/// see override build() in [BlockableOverlay] /// see override build() in [BlockableOverlay]
body: BlockableOverlay( body: Stack(
state: _blockableOverlayState, children: [
underlying: Container( Container(
color: Colors.black, color: Colors.black,
child: RawKeyFocusScope( child: RawKeyFocusScope(
focusNode: _rawKeyFocusNode, focusNode: _rawKeyFocusNode,
@ -260,9 +273,8 @@ class _RemotePageState extends State<RemotePage>
}, },
inputModel: _ffi.inputModel, inputModel: _ffi.inputModel,
child: getBodyForDesktop(context))), child: getBodyForDesktop(context))),
upperLayer: [ emptyOverlay(),
OverlayEntry( RemoteToolbar(
builder: (context) => RemoteToolbar(
id: widget.id, id: widget.id,
ffi: _ffi, ffi: _ffi,
state: widget.toolbarState, state: widget.toolbarState,
@ -270,7 +282,7 @@ class _RemotePageState extends State<RemotePage>
_onEnterOrLeaveImage4Toolbar = func, _onEnterOrLeaveImage4Toolbar = func,
onEnterOrLeaveImageCleaner: () => onEnterOrLeaveImageCleaner: () =>
_onEnterOrLeaveImage4Toolbar = null, _onEnterOrLeaveImage4Toolbar = null,
)) ),
], ],
), ),
); );

View File

@ -2100,6 +2100,9 @@ fn _input_os_password(p: String, activate: bool, interface: impl Interface) {
activate_os(&interface); activate_os(&interface);
std::thread::sleep(Duration::from_millis(1200)); std::thread::sleep(Duration::from_millis(1200));
} }
if p.is_empty() {
return;
}
let mut key_event = KeyEvent::new(); let mut key_event = KeyEvent::new();
key_event.press = true; key_event.press = true;
let mut msg_out = Message::new(); let mut msg_out = Message::new();

View File

@ -25,7 +25,7 @@ use hbb_common::{
protobuf::Enum, protobuf::Enum,
protobuf::Message as _, protobuf::Message as _,
rendezvous_proto::*, rendezvous_proto::*,
sleep, socket_client, socket_client,
tcp::FramedStream, tcp::FramedStream,
tokio, ResultType, tokio, ResultType,
}; };