Skip to content

Commit

Permalink
Merge branch 'rustdesk:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangbo8418 authored Aug 26, 2024
2 parents 4475752 + 4b4fd94 commit 3be2498
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 2 deletions.
3 changes: 3 additions & 0 deletions flutter/lib/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ final isLinux = isLinux_;
final isDesktop = isDesktop_;
final isWeb = isWeb_;
final isWebDesktop = isWebDesktop_;
final isWebOnWindows = isWebOnWindows_;
final isWebOnLinux = isWebOnLinux_;
final isWebOnMacOs = isWebOnMacOS_;
var isMobile = isAndroid || isIOS;
var version = '';
int androidVersion = 0;
Expand Down
1 change: 1 addition & 0 deletions flutter/lib/consts.dart
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ const String kPeerPlatformWindows = "Windows";
const String kPeerPlatformLinux = "Linux";
const String kPeerPlatformMacOS = "Mac OS";
const String kPeerPlatformAndroid = "Android";
const String kPeerPlatformWebDesktop = "WebDesktop";

const double kScrollbarThickness = 12.0;

Expand Down
3 changes: 2 additions & 1 deletion flutter/lib/desktop/widgets/kb_layout_type_chooser.dart
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,9 @@ String getLocalPlatformForKBLayoutType(String peerPlatform) {
localPlatform = kPeerPlatformWindows;
} else if (isLinux) {
localPlatform = kPeerPlatformLinux;
} else if (isWebOnWindows || isWebOnLinux) {
localPlatform = kPeerPlatformWebDesktop;
}
// to-do: web desktop support ?
return localPlatform;
}

Expand Down
4 changes: 4 additions & 0 deletions flutter/lib/native/common.dart
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ final isWebDesktop_ = false;
final isDesktop_ = Platform.isWindows || Platform.isMacOS || Platform.isLinux;

String get screenInfo_ => '';

final isWebOnWindows_ = false;
final isWebOnLinux_ = false;
final isWebOnMacOS_ = false;
13 changes: 12 additions & 1 deletion flutter/lib/web/bridge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class RustdeskImpl {
}

String getLocalKbLayoutType({dynamic hint}) {
throw js.context.callMethod('getByName', ['option:local', 'kb_layout']);
return js.context.callMethod('getByName', ['option:local', 'kb_layout']);
}

Future<void> setLocalKbLayoutType(
Expand Down Expand Up @@ -415,6 +415,17 @@ class RustdeskImpl {
]));
}

Future<void> sessionHandleFlutterRawKeyEvent(
{required UuidValue sessionId,
required String name,
required int platformCode,
required int positionCode,
required int lockModes,
required bool downOrUp,
dynamic hint}) {
throw UnimplementedError();
}

void sessionEnterOrLeave(
{required UuidValue sessionId, required bool enter, dynamic hint}) {
throw UnimplementedError();
Expand Down
7 changes: 7 additions & 0 deletions flutter/lib/web/common.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import 'dart:js' as js;
import 'dart:html' as html;

final isAndroid_ = false;
final isIOS_ = false;
Expand All @@ -11,3 +12,9 @@ final isWebDesktop_ = !js.context.callMethod('isMobile');
final isDesktop_ = false;

String get screenInfo_ => js.context.callMethod('getByName', ['screen_info']);

final _userAgent = html.window.navigator.userAgent.toLowerCase();

final isWebOnWindows_ = _userAgent.contains('win');
final isWebOnLinux_ = _userAgent.contains('linux');
final isWebOnMacOS_ = _userAgent.contains('mac');
3 changes: 3 additions & 0 deletions src/server/input_service.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,9 @@ fn run_cursor(sp: MouseCursorService, state: &mut StateCursor) -> ResultType<()>

fn run_window_focus(sp: EmptyExtraFieldService, state: &mut StateWindowFocus) -> ResultType<()> {
let displays = super::display_service::get_sync_displays();
if displays.len() <= 1 {
return Ok(());
}
let disp_idx = crate::get_focused_display(displays);
if let Some(disp_idx) = disp_idx.map(|id| id as i32) {
if state.is_changed(disp_idx) {
Expand Down

0 comments on commit 3be2498

Please sign in to comment.