Merge pull request #2693 from fufesou/refact/trivial_changes
fix some misspellings
This commit is contained in:
commit
0dcf10616d
@ -315,7 +315,7 @@ class _RemotePageState extends State<RemotePage>
|
|||||||
}))
|
}))
|
||||||
];
|
];
|
||||||
|
|
||||||
if (!_ffi.canvasModel.cursorEmbeded) {
|
if (!_ffi.canvasModel.cursorEmbedded) {
|
||||||
paints.add(Obx(() => Offstage(
|
paints.add(Obx(() => Offstage(
|
||||||
offstage: _showRemoteCursor.isFalse || _remoteCursorMoved.isFalse,
|
offstage: _showRemoteCursor.isFalse || _remoteCursorMoved.isFalse,
|
||||||
child: CursorPaint(
|
child: CursorPaint(
|
||||||
@ -382,7 +382,7 @@ class _ImagePaintState extends State<ImagePaint> {
|
|||||||
|
|
||||||
mouseRegion({child}) => Obx(() => MouseRegion(
|
mouseRegion({child}) => Obx(() => MouseRegion(
|
||||||
cursor: cursorOverImage.isTrue
|
cursor: cursorOverImage.isTrue
|
||||||
? c.cursorEmbeded
|
? c.cursorEmbedded
|
||||||
? SystemMouseCursors.none
|
? SystemMouseCursors.none
|
||||||
: keyboardEnabled.isTrue
|
: keyboardEnabled.isTrue
|
||||||
? (() {
|
? (() {
|
||||||
|
@ -257,7 +257,7 @@ class _ConnectionTabPageState extends State<ConnectionTabPage> {
|
|||||||
),
|
),
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (!ffi.canvasModel.cursorEmbeded) {
|
if (!ffi.canvasModel.cursorEmbedded) {
|
||||||
menu.add(MenuEntryDivider<String>());
|
menu.add(MenuEntryDivider<String>());
|
||||||
menu.add(() {
|
menu.add(() {
|
||||||
final state = ShowRemoteCursorState.find(key);
|
final state = ShowRemoteCursorState.find(key);
|
||||||
|
@ -9,7 +9,7 @@ import '../../common.dart';
|
|||||||
typedef KBChoosedCallback = Future<bool> Function(String);
|
typedef KBChoosedCallback = Future<bool> Function(String);
|
||||||
|
|
||||||
const double _kImageMarginVertical = 6.0;
|
const double _kImageMarginVertical = 6.0;
|
||||||
const double _kImageMarginHorizental = 10.0;
|
const double _kImageMarginHorizontal = 10.0;
|
||||||
const double _kImageBoarderWidth = 4.0;
|
const double _kImageBoarderWidth = 4.0;
|
||||||
const double _kImagePaddingWidth = 4.0;
|
const double _kImagePaddingWidth = 4.0;
|
||||||
const Color _kImageBorderColor = Color.fromARGB(125, 202, 247, 2);
|
const Color _kImageBorderColor = Color.fromARGB(125, 202, 247, 2);
|
||||||
@ -47,14 +47,14 @@ class _KBImage extends StatelessWidget {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
margin: EdgeInsets.symmetric(
|
margin: EdgeInsets.symmetric(
|
||||||
horizontal: _kImageMarginHorizental,
|
horizontal: _kImageMarginHorizontal,
|
||||||
vertical: _kImageMarginVertical,
|
vertical: _kImageMarginVertical,
|
||||||
),
|
),
|
||||||
padding: EdgeInsets.all(_kImagePaddingWidth),
|
padding: EdgeInsets.all(_kImagePaddingWidth),
|
||||||
child: SvgPicture.asset(
|
child: SvgPicture.asset(
|
||||||
'assets/${_kKBLayoutImageMap[kbLayoutType] ?? ""}.svg',
|
'assets/${_kKBLayoutImageMap[kbLayoutType] ?? ""}.svg',
|
||||||
width: imageWidth -
|
width: imageWidth -
|
||||||
_kImageMarginHorizental * 2 -
|
_kImageMarginHorizontal * 2 -
|
||||||
_kImagePaddingWidth * 2 -
|
_kImagePaddingWidth * 2 -
|
||||||
_kImageBoarderWidth * 2,
|
_kImageBoarderWidth * 2,
|
||||||
),
|
),
|
||||||
|
@ -1086,7 +1086,7 @@ class _RemoteMenubarState extends State<RemoteMenubar> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Show remote cursor
|
/// Show remote cursor
|
||||||
if (!widget.ffi.canvasModel.cursorEmbeded) {
|
if (!widget.ffi.canvasModel.cursorEmbedded) {
|
||||||
displayMenu.add(() {
|
displayMenu.add(() {
|
||||||
final state = ShowRemoteCursorState.find(widget.id);
|
final state = ShowRemoteCursorState.find(widget.id);
|
||||||
return MenuEntrySwitch2<String>(
|
return MenuEntrySwitch2<String>(
|
||||||
|
@ -518,7 +518,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
),
|
),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
if (!gFFI.canvasModel.cursorEmbeded) {
|
if (!gFFI.canvasModel.cursorEmbedded) {
|
||||||
paints.add(CursorPaint());
|
paints.add(CursorPaint());
|
||||||
}
|
}
|
||||||
return paints;
|
return paints;
|
||||||
@ -527,7 +527,7 @@ class _RemotePageState extends State<RemotePage> {
|
|||||||
|
|
||||||
Widget getBodyForDesktopWithListener(bool keyboard) {
|
Widget getBodyForDesktopWithListener(bool keyboard) {
|
||||||
var paints = <Widget>[ImagePaint()];
|
var paints = <Widget>[ImagePaint()];
|
||||||
if (!gFFI.canvasModel.cursorEmbeded) {
|
if (!gFFI.canvasModel.cursorEmbedded) {
|
||||||
final cursor = bind.sessionGetToggleOptionSync(
|
final cursor = bind.sessionGetToggleOptionSync(
|
||||||
id: widget.id, arg: 'show-remote-cursor');
|
id: widget.id, arg: 'show-remote-cursor');
|
||||||
if (keyboard || cursor) {
|
if (keyboard || cursor) {
|
||||||
@ -1058,7 +1058,7 @@ void showOptions(
|
|||||||
final toggles = [
|
final toggles = [
|
||||||
getToggle(id, setState, 'show-quality-monitor', 'Show quality monitor'),
|
getToggle(id, setState, 'show-quality-monitor', 'Show quality monitor'),
|
||||||
];
|
];
|
||||||
if (!gFFI.canvasModel.cursorEmbeded) {
|
if (!gFFI.canvasModel.cursorEmbedded) {
|
||||||
toggles.insert(0,
|
toggles.insert(0,
|
||||||
getToggle(id, setState, 'show-remote-cursor', 'Show remote cursor'));
|
getToggle(id, setState, 'show-remote-cursor', 'Show remote cursor'));
|
||||||
}
|
}
|
||||||
|
@ -222,7 +222,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
_display.y = double.parse(evt['y']);
|
_display.y = double.parse(evt['y']);
|
||||||
_display.width = int.parse(evt['width']);
|
_display.width = int.parse(evt['width']);
|
||||||
_display.height = int.parse(evt['height']);
|
_display.height = int.parse(evt['height']);
|
||||||
_display.cursorEmbeded = int.parse(evt['cursor_embeded']) == 1;
|
_display.cursorEmbedded = int.parse(evt['cursor_embedded']) == 1;
|
||||||
if (old != _pi.currentDisplay) {
|
if (old != _pi.currentDisplay) {
|
||||||
parent.target?.cursorModel.updateDisplayOrigin(_display.x, _display.y);
|
parent.target?.cursorModel.updateDisplayOrigin(_display.x, _display.y);
|
||||||
}
|
}
|
||||||
@ -338,7 +338,7 @@ class FfiModel with ChangeNotifier {
|
|||||||
d.y = d0['y'].toDouble();
|
d.y = d0['y'].toDouble();
|
||||||
d.width = d0['width'];
|
d.width = d0['width'];
|
||||||
d.height = d0['height'];
|
d.height = d0['height'];
|
||||||
d.cursorEmbeded = d0['cursor_embeded'] == 1;
|
d.cursorEmbedded = d0['cursor_embedded'] == 1;
|
||||||
_pi.displays.add(d);
|
_pi.displays.add(d);
|
||||||
}
|
}
|
||||||
if (_pi.currentDisplay < _pi.displays.length) {
|
if (_pi.currentDisplay < _pi.displays.length) {
|
||||||
@ -608,8 +608,8 @@ class CanvasModel with ChangeNotifier {
|
|||||||
notifyListeners();
|
notifyListeners();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool get cursorEmbeded =>
|
bool get cursorEmbedded =>
|
||||||
parent.target?.ffiModel.display.cursorEmbeded ?? false;
|
parent.target?.ffiModel.display.cursorEmbedded ?? false;
|
||||||
|
|
||||||
int getDisplayWidth() {
|
int getDisplayWidth() {
|
||||||
final defaultWidth = (isDesktop || isWebDesktop)
|
final defaultWidth = (isDesktop || isWebDesktop)
|
||||||
@ -1343,7 +1343,7 @@ class Display {
|
|||||||
double y = 0;
|
double y = 0;
|
||||||
int width = 0;
|
int width = 0;
|
||||||
int height = 0;
|
int height = 0;
|
||||||
bool cursorEmbeded = false;
|
bool cursorEmbedded = false;
|
||||||
|
|
||||||
Display() {
|
Display() {
|
||||||
width = (isDesktop || isWebDesktop)
|
width = (isDesktop || isWebDesktop)
|
||||||
|
@ -40,7 +40,7 @@ message DisplayInfo {
|
|||||||
int32 height = 4;
|
int32 height = 4;
|
||||||
string name = 5;
|
string name = 5;
|
||||||
bool online = 6;
|
bool online = 6;
|
||||||
bool cursor_embeded = 7;
|
bool cursor_embedded = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PortForward {
|
message PortForward {
|
||||||
@ -420,7 +420,7 @@ message SwitchDisplay {
|
|||||||
sint32 y = 3;
|
sint32 y = 3;
|
||||||
int32 width = 4;
|
int32 width = 4;
|
||||||
int32 height = 5;
|
int32 height = 5;
|
||||||
bool cursor_embeded = 6;
|
bool cursor_embedded = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
message PermissionInfo {
|
message PermissionInfo {
|
||||||
|
@ -72,16 +72,16 @@ pub fn is_x11() -> bool {
|
|||||||
|
|
||||||
#[cfg(x11)]
|
#[cfg(x11)]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_cursor_embeded() -> bool {
|
pub fn is_cursor_embedded() -> bool {
|
||||||
if is_x11() {
|
if is_x11() {
|
||||||
x11::IS_CURSOR_EMBEDED
|
x11::is_cursor_embedded
|
||||||
} else {
|
} else {
|
||||||
wayland::IS_CURSOR_EMBEDED
|
wayland::is_cursor_embedded
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(not(x11))]
|
#[cfg(not(x11))]
|
||||||
#[inline]
|
#[inline]
|
||||||
pub fn is_cursor_embeded() -> bool {
|
pub fn is_cursor_embedded() -> bool {
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
@ -4,7 +4,7 @@ use std::{io, sync::RwLock, time::Duration};
|
|||||||
|
|
||||||
pub struct Capturer(Display, Box<dyn Recorder>, bool, Vec<u8>);
|
pub struct Capturer(Display, Box<dyn Recorder>, bool, Vec<u8>);
|
||||||
|
|
||||||
pub const IS_CURSOR_EMBEDED: bool = true;
|
pub const is_cursor_embedded: bool = true;
|
||||||
|
|
||||||
lazy_static::lazy_static! {
|
lazy_static::lazy_static! {
|
||||||
static ref MAP_ERR: RwLock<Option<fn(err: String)-> io::Error>> = Default::default();
|
static ref MAP_ERR: RwLock<Option<fn(err: String)-> io::Error>> = Default::default();
|
||||||
|
@ -3,7 +3,7 @@ use std::{io, ops, time::Duration};
|
|||||||
|
|
||||||
pub struct Capturer(x11::Capturer);
|
pub struct Capturer(x11::Capturer);
|
||||||
|
|
||||||
pub const IS_CURSOR_EMBEDED: bool = false;
|
pub const is_cursor_embedded: bool = false;
|
||||||
|
|
||||||
impl Capturer {
|
impl Capturer {
|
||||||
pub fn new(display: Display, yuv: bool) -> io::Result<Capturer> {
|
pub fn new(display: Display, yuv: bool) -> io::Result<Capturer> {
|
||||||
|
@ -990,7 +990,7 @@ impl<T: InvokeUiSession> Remote<T> {
|
|||||||
self.video_sender.send(MediaData::Reset).ok();
|
self.video_sender.send(MediaData::Reset).ok();
|
||||||
if s.width > 0 && s.height > 0 {
|
if s.width > 0 && s.height > 0 {
|
||||||
self.handler
|
self.handler
|
||||||
.set_display(s.x, s.y, s.width, s.height, s.cursor_embeded);
|
.set_display(s.x, s.y, s.width, s.height, s.cursor_embedded);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(misc::Union::CloseReason(c)) => {
|
Some(misc::Union::CloseReason(c)) => {
|
||||||
|
@ -156,7 +156,7 @@ impl InvokeUiSession for FlutterHandler {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// unused in flutter, use switch_display or set_peer_info
|
/// unused in flutter, use switch_display or set_peer_info
|
||||||
fn set_display(&self, _x: i32, _y: i32, _w: i32, _h: i32, _cursor_embeded: bool) {}
|
fn set_display(&self, _x: i32, _y: i32, _w: i32, _h: i32, _cursor_embedded: bool) {}
|
||||||
|
|
||||||
fn update_privacy_mode(&self) {
|
fn update_privacy_mode(&self) {
|
||||||
self.push_event("update_privacy_mode", [].into());
|
self.push_event("update_privacy_mode", [].into());
|
||||||
@ -296,7 +296,7 @@ impl InvokeUiSession for FlutterHandler {
|
|||||||
h.insert("y", d.y);
|
h.insert("y", d.y);
|
||||||
h.insert("width", d.width);
|
h.insert("width", d.width);
|
||||||
h.insert("height", d.height);
|
h.insert("height", d.height);
|
||||||
h.insert("cursor_embeded", if d.cursor_embeded { 1 } else { 0 });
|
h.insert("cursor_embedded", if d.cursor_embedded { 1 } else { 0 });
|
||||||
displays.push(h);
|
displays.push(h);
|
||||||
}
|
}
|
||||||
let displays = serde_json::ser::to_string(&displays).unwrap_or("".to_owned());
|
let displays = serde_json::ser::to_string(&displays).unwrap_or("".to_owned());
|
||||||
@ -357,7 +357,7 @@ impl InvokeUiSession for FlutterHandler {
|
|||||||
("y", &display.y.to_string()),
|
("y", &display.y.to_string()),
|
||||||
("width", &display.width.to_string()),
|
("width", &display.width.to_string()),
|
||||||
("height", &display.height.to_string()),
|
("height", &display.height.to_string()),
|
||||||
("cursor_embeded", &{if display.cursor_embeded {1} else {0}}.to_string()),
|
("cursor_embedded", &{if display.cursor_embedded {1} else {0}}.to_string()),
|
||||||
],
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ pub fn new() -> ServerPtr {
|
|||||||
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
#[cfg(not(any(target_os = "android", target_os = "ios")))]
|
||||||
{
|
{
|
||||||
server.add_service(Box::new(clipboard_service::new()));
|
server.add_service(Box::new(clipboard_service::new()));
|
||||||
if !video_service::capture_cursor_embeded() {
|
if !video_service::capture_cursor_embedded() {
|
||||||
server.add_service(Box::new(input_service::new_cursor()));
|
server.add_service(Box::new(input_service::new_cursor()));
|
||||||
server.add_service(Box::new(input_service::new_pos()));
|
server.add_service(Box::new(input_service::new_pos()));
|
||||||
}
|
}
|
||||||
|
@ -400,7 +400,7 @@ impl Connection {
|
|||||||
},
|
},
|
||||||
Some((instant, value)) = rx_video.recv() => {
|
Some((instant, value)) = rx_video.recv() => {
|
||||||
if !conn.video_ack_required {
|
if !conn.video_ack_required {
|
||||||
video_service::notify_video_frame_feched(id, Some(instant.into()));
|
video_service::notify_video_frame_fetched(id, Some(instant.into()));
|
||||||
}
|
}
|
||||||
if let Err(err) = conn.stream.send(&value as &Message).await {
|
if let Err(err) = conn.stream.send(&value as &Message).await {
|
||||||
conn.on_close(&err.to_string(), false).await;
|
conn.on_close(&err.to_string(), false).await;
|
||||||
@ -499,7 +499,7 @@ impl Connection {
|
|||||||
} else if video_privacy_conn_id == 0 {
|
} else if video_privacy_conn_id == 0 {
|
||||||
let _ = privacy_mode::turn_off_privacy(0);
|
let _ = privacy_mode::turn_off_privacy(0);
|
||||||
}
|
}
|
||||||
video_service::notify_video_frame_feched(id, None);
|
video_service::notify_video_frame_fetched(id, None);
|
||||||
scrap::codec::Encoder::update_video_encoder(id, scrap::codec::EncoderUpdate::Remove);
|
scrap::codec::Encoder::update_video_encoder(id, scrap::codec::EncoderUpdate::Remove);
|
||||||
video_service::VIDEO_QOS.lock().unwrap().reset();
|
video_service::VIDEO_QOS.lock().unwrap().reset();
|
||||||
if conn.authorized {
|
if conn.authorized {
|
||||||
@ -1464,7 +1464,7 @@ impl Connection {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
Some(misc::Union::VideoReceived(_)) => {
|
Some(misc::Union::VideoReceived(_)) => {
|
||||||
video_service::notify_video_frame_feched(
|
video_service::notify_video_frame_fetched(
|
||||||
self.inner.id,
|
self.inner.id,
|
||||||
Some(Instant::now().into()),
|
Some(Instant::now().into()),
|
||||||
);
|
);
|
||||||
|
@ -78,11 +78,11 @@ fn is_capturer_mag_supported() -> bool {
|
|||||||
false
|
false
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn capture_cursor_embeded() -> bool {
|
pub fn capture_cursor_embedded() -> bool {
|
||||||
scrap::is_cursor_embeded()
|
scrap::is_cursor_embedded()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn notify_video_frame_feched(conn_id: i32, frame_tm: Option<Instant>) {
|
pub fn notify_video_frame_fetched(conn_id: i32, frame_tm: Option<Instant>) {
|
||||||
FRAME_FETCHED_NOTIFIER.0.send((conn_id, frame_tm)).unwrap()
|
FRAME_FETCHED_NOTIFIER.0.send((conn_id, frame_tm)).unwrap()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ impl VideoFrameController {
|
|||||||
fetched_conn_ids.insert(id);
|
fetched_conn_ids.insert(id);
|
||||||
}
|
}
|
||||||
Ok(None) => {
|
Ok(None) => {
|
||||||
// this branch would nerver be reached
|
// this branch would never be reached
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -162,7 +162,7 @@ fn check_display_changed(
|
|||||||
last_n: usize,
|
last_n: usize,
|
||||||
last_current: usize,
|
last_current: usize,
|
||||||
last_width: usize,
|
last_width: usize,
|
||||||
last_hegiht: usize,
|
last_height: usize,
|
||||||
) -> bool {
|
) -> bool {
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
{
|
{
|
||||||
@ -187,7 +187,7 @@ fn check_display_changed(
|
|||||||
if i != last_current {
|
if i != last_current {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
if d.width() != last_width || d.height() != last_hegiht {
|
if d.width() != last_width || d.height() != last_height {
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -249,7 +249,7 @@ fn create_capturer(
|
|||||||
PRIVACY_WINDOW_NAME
|
PRIVACY_WINDOW_NAME
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
log::debug!("Create maginifier capture for {}", privacy_mode_id);
|
log::debug!("Create magnifier capture for {}", privacy_mode_id);
|
||||||
c = Some(Box::new(c1));
|
c = Some(Box::new(c1));
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
@ -385,10 +385,12 @@ fn get_capturer(use_yuv: bool, portable_service_running: bool) -> ResultType<Cap
|
|||||||
captuerer_privacy_mode_id,
|
captuerer_privacy_mode_id,
|
||||||
);
|
);
|
||||||
|
|
||||||
if privacy_mode_id != captuerer_privacy_mode_id {
|
if privacy_mode_id != 0 {
|
||||||
log::info!("In privacy mode, but show UAC prompt window for now");
|
if privacy_mode_id != captuerer_privacy_mode_id {
|
||||||
} else {
|
log::info!("In privacy mode, but show UAC prompt window for now");
|
||||||
log::info!("In privacy mode, the peer side cannot watch the screen");
|
} else {
|
||||||
|
log::info!("In privacy mode, the peer side cannot watch the screen");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
let capturer = create_capturer(
|
let capturer = create_capturer(
|
||||||
captuerer_privacy_mode_id,
|
captuerer_privacy_mode_id,
|
||||||
@ -413,7 +415,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
|||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
ensure_close_virtual_device()?;
|
ensure_close_virtual_device()?;
|
||||||
|
|
||||||
// ensure_inited() is needed because release_resouce() may be called.
|
// ensure_inited() is needed because release_resource() may be called.
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
super::wayland::ensure_inited()?;
|
super::wayland::ensure_inited()?;
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
@ -464,7 +466,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
|||||||
y: c.origin.1 as _,
|
y: c.origin.1 as _,
|
||||||
width: c.width as _,
|
width: c.width as _,
|
||||||
height: c.height as _,
|
height: c.height as _,
|
||||||
cursor_embeded: capture_cursor_embeded(),
|
cursor_embedded: capture_cursor_embedded(),
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
let mut msg_out = Message::new();
|
let mut msg_out = Message::new();
|
||||||
@ -599,7 +601,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
|||||||
would_block_count += 1;
|
would_block_count += 1;
|
||||||
if !scrap::is_x11() {
|
if !scrap::is_x11() {
|
||||||
if would_block_count >= 100 {
|
if would_block_count >= 100 {
|
||||||
super::wayland::release_resouce();
|
super::wayland::release_resource();
|
||||||
bail!("Wayland capturer none 100 times, try restart captuere");
|
bail!("Wayland capturer none 100 times, try restart captuere");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -653,7 +655,7 @@ fn run(sp: GenericService) -> ResultType<()> {
|
|||||||
|
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
if !scrap::is_x11() {
|
if !scrap::is_x11() {
|
||||||
super::wayland::release_resouce();
|
super::wayland::release_resource();
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
@ -821,7 +823,7 @@ pub(super) fn get_displays_2(all: &Vec<Display>) -> (usize, Vec<DisplayInfo>) {
|
|||||||
height: d.height() as _,
|
height: d.height() as _,
|
||||||
name: d.name(),
|
name: d.name(),
|
||||||
online: d.is_online(),
|
online: d.is_online(),
|
||||||
cursor_embeded: false,
|
cursor_embedded: false,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -129,7 +129,7 @@ pub(super) async fn check_init() -> ResultType<()> {
|
|||||||
let num = all.len();
|
let num = all.len();
|
||||||
let (primary, mut displays) = super::video_service::get_displays_2(&all);
|
let (primary, mut displays) = super::video_service::get_displays_2(&all);
|
||||||
for display in displays.iter_mut() {
|
for display in displays.iter_mut() {
|
||||||
display.cursor_embeded = true;
|
display.cursor_embedded = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut rects: Vec<((i32, i32), usize, usize)> = Vec::new();
|
let mut rects: Vec<((i32, i32), usize, usize)> = Vec::new();
|
||||||
@ -244,7 +244,7 @@ pub(super) fn get_display_num() -> ResultType<usize> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
#[allow(dead_code)]
|
#[allow(dead_code)]
|
||||||
pub(super) fn release_resouce() {
|
pub(super) fn release_resource() {
|
||||||
if scrap::is_x11() {
|
if scrap::is_x11() {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -164,10 +164,10 @@ class Header: Reactor.Component {
|
|||||||
var codecs = handler.supported_hwcodec();
|
var codecs = handler.supported_hwcodec();
|
||||||
var show_codec = handler.has_hwcodec() && (codecs[0] || codecs[1]);
|
var show_codec = handler.has_hwcodec() && (codecs[0] || codecs[1]);
|
||||||
|
|
||||||
var cursor_embeded = false;
|
var cursor_embedded = false;
|
||||||
if ((pi.displays || []).length > 0) {
|
if ((pi.displays || []).length > 0) {
|
||||||
if (pi.displays.length > pi.current_display) {
|
if (pi.displays.length > pi.current_display) {
|
||||||
cursor_embeded = pi.displays[pi.current_display].cursor_embeded;
|
cursor_embedded = pi.displays[pi.current_display].cursor_embedded;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ class Header: Reactor.Component {
|
|||||||
{codecs[1] ? <li #h265 type="codec-preference"><span>{svg_checkmark}</span>H265</li> : ""}
|
{codecs[1] ? <li #h265 type="codec-preference"><span>{svg_checkmark}</span>H265</li> : ""}
|
||||||
</div> : ""}
|
</div> : ""}
|
||||||
<div .separator />
|
<div .separator />
|
||||||
{!cursor_embeded && <li #show-remote-cursor .toggle-option><span>{svg_checkmark}</span>{translate('Show remote cursor')}</li>}
|
{!cursor_embedded && <li #show-remote-cursor .toggle-option><span>{svg_checkmark}</span>{translate('Show remote cursor')}</li>}
|
||||||
<li #show-quality-monitor .toggle-option><span>{svg_checkmark}</span>{translate('Show quality monitor')}</li>
|
<li #show-quality-monitor .toggle-option><span>{svg_checkmark}</span>{translate('Show quality monitor')}</li>
|
||||||
{audio_enabled ? <li #disable-audio .toggle-option><span>{svg_checkmark}</span>{translate('Mute')}</li> : ""}
|
{audio_enabled ? <li #disable-audio .toggle-option><span>{svg_checkmark}</span>{translate('Mute')}</li> : ""}
|
||||||
{is_win && pi.platform == 'Windows' && file_enabled ? <li #enable-file-transfer .toggle-option><span>{svg_checkmark}</span>{translate('Allow file copy and paste')}</li> : ""}
|
{is_win && pi.platform == 'Windows' && file_enabled ? <li #enable-file-transfer .toggle-option><span>{svg_checkmark}</span>{translate('Allow file copy and paste')}</li> : ""}
|
||||||
|
@ -79,8 +79,8 @@ impl InvokeUiSession for SciterHandler {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embeded: bool) {
|
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embedded: bool) {
|
||||||
self.call("setDisplay", &make_args!(x, y, w, h, cursor_embeded));
|
self.call("setDisplay", &make_args!(x, y, w, h, cursor_embedded));
|
||||||
// https://sciter.com/forums/topic/color_spaceiyuv-crash
|
// https://sciter.com/forums/topic/color_spaceiyuv-crash
|
||||||
// Nothing spectacular in decoder – done on CPU side.
|
// Nothing spectacular in decoder – done on CPU side.
|
||||||
// So if you can do BGRA translation on your side – the better.
|
// So if you can do BGRA translation on your side – the better.
|
||||||
@ -223,7 +223,7 @@ impl InvokeUiSession for SciterHandler {
|
|||||||
display.set_item("y", d.y);
|
display.set_item("y", d.y);
|
||||||
display.set_item("width", d.width);
|
display.set_item("width", d.width);
|
||||||
display.set_item("height", d.height);
|
display.set_item("height", d.height);
|
||||||
display.set_item("cursor_embeded", d.cursor_embeded);
|
display.set_item("cursor_embedded", d.cursor_embedded);
|
||||||
displays.push(display);
|
displays.push(display);
|
||||||
}
|
}
|
||||||
pi_sciter.set_item("displays", displays);
|
pi_sciter.set_item("displays", displays);
|
||||||
|
@ -6,7 +6,7 @@ var display_width = 0;
|
|||||||
var display_height = 0;
|
var display_height = 0;
|
||||||
var display_origin_x = 0;
|
var display_origin_x = 0;
|
||||||
var display_origin_y = 0;
|
var display_origin_y = 0;
|
||||||
var display_cursor_embeded = false;
|
var display_cursor_embedded = false;
|
||||||
var display_scale = 1;
|
var display_scale = 1;
|
||||||
var keyboard_enabled = true; // server side
|
var keyboard_enabled = true; // server side
|
||||||
var clipboard_enabled = true; // server side
|
var clipboard_enabled = true; // server side
|
||||||
@ -16,12 +16,12 @@ var restart_enabled = true; // server side
|
|||||||
var recording_enabled = true; // server side
|
var recording_enabled = true; // server side
|
||||||
var scroll_body = $(body);
|
var scroll_body = $(body);
|
||||||
|
|
||||||
handler.setDisplay = function(x, y, w, h, cursor_embeded) {
|
handler.setDisplay = function(x, y, w, h, cursor_embedded) {
|
||||||
display_width = w;
|
display_width = w;
|
||||||
display_height = h;
|
display_height = h;
|
||||||
display_origin_x = x;
|
display_origin_x = x;
|
||||||
display_origin_y = y;
|
display_origin_y = y;
|
||||||
display_cursor_embeded = cursor_embeded;
|
display_cursor_embedded = cursor_embedded;
|
||||||
adaptDisplay();
|
adaptDisplay();
|
||||||
if (recording) handler.record_screen(true, w, h);
|
if (recording) handler.record_screen(true, w, h);
|
||||||
}
|
}
|
||||||
@ -197,7 +197,7 @@ function handler.onMouse(evt)
|
|||||||
dragging = false;
|
dragging = false;
|
||||||
break;
|
break;
|
||||||
case Event.MOUSE_MOVE:
|
case Event.MOUSE_MOVE:
|
||||||
if (display_cursor_embeded) {
|
if (display_cursor_embedded) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (cursor_img.style#display != "none" && keyboard_enabled) {
|
if (cursor_img.style#display != "none" && keyboard_enabled) {
|
||||||
@ -365,7 +365,7 @@ function updateCursor(system=false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function refreshCursor() {
|
function refreshCursor() {
|
||||||
if (display_cursor_embeded) {
|
if (display_cursor_embedded) {
|
||||||
cursor_img.style#display = "none";
|
cursor_img.style#display = "none";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -604,7 +604,7 @@ pub trait InvokeUiSession: Send + Sync + Clone + 'static + Sized + Default {
|
|||||||
fn set_cursor_data(&self, cd: CursorData);
|
fn set_cursor_data(&self, cd: CursorData);
|
||||||
fn set_cursor_id(&self, id: String);
|
fn set_cursor_id(&self, id: String);
|
||||||
fn set_cursor_position(&self, cp: CursorPosition);
|
fn set_cursor_position(&self, cp: CursorPosition);
|
||||||
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embeded: bool);
|
fn set_display(&self, x: i32, y: i32, w: i32, h: i32, cursor_embedded: bool);
|
||||||
fn switch_display(&self, display: &SwitchDisplay);
|
fn switch_display(&self, display: &SwitchDisplay);
|
||||||
fn set_peer_info(&self, peer_info: &PeerInfo); // flutter
|
fn set_peer_info(&self, peer_info: &PeerInfo); // flutter
|
||||||
fn on_connected(&self, conn_type: ConnType);
|
fn on_connected(&self, conn_type: ConnType);
|
||||||
@ -710,7 +710,7 @@ impl<T: InvokeUiSession> Interface for Session<T> {
|
|||||||
current.y,
|
current.y,
|
||||||
current.width,
|
current.width,
|
||||||
current.height,
|
current.height,
|
||||||
current.cursor_embeded,
|
current.cursor_embedded,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
self.update_privacy_mode();
|
self.update_privacy_mode();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user