mirror of
https://github.com/rustdesk/rustdesk.git
synced 2025-12-12 02:57:22 +00:00
add desktop
This commit is contained in:
@@ -282,7 +282,7 @@ class ImageModel with ChangeNotifier {
|
||||
|
||||
void update(ui.Image? image) {
|
||||
if (_image == null && image != null) {
|
||||
if (isDesktop) {
|
||||
if (isWebDesktop) {
|
||||
FFI.canvasModel.updateViewStyle();
|
||||
} else {
|
||||
final size = MediaQueryData.fromWindow(ui.window).size;
|
||||
@@ -394,7 +394,7 @@ class CanvasModel with ChangeNotifier {
|
||||
}
|
||||
|
||||
void resetOffset() {
|
||||
if (isDesktop) {
|
||||
if (isWebDesktop) {
|
||||
updateViewStyle();
|
||||
} else {
|
||||
_x = 0;
|
||||
@@ -783,7 +783,7 @@ class FFI {
|
||||
|
||||
static void close() {
|
||||
chatModel.close();
|
||||
if (FFI.imageModel.image != null && !isDesktop) {
|
||||
if (FFI.imageModel.image != null && !isWebDesktop) {
|
||||
savePreference(id, cursorModel.x, cursorModel.y, canvasModel.x,
|
||||
canvasModel.y, canvasModel.scale, ffiModel.pi.currentDisplay);
|
||||
}
|
||||
@@ -919,7 +919,7 @@ void savePreference(String id, double xCursor, double yCursor, double xCanvas,
|
||||
}
|
||||
|
||||
Future<Map<String, dynamic>?> getPreference(String id) async {
|
||||
if (!isDesktop) return null;
|
||||
if (!isWebDesktop) return null;
|
||||
SharedPreferences prefs = await SharedPreferences.getInstance();
|
||||
var p = prefs.getString('peer' + id);
|
||||
if (p == null) return null;
|
||||
|
||||
@@ -59,6 +59,11 @@ class PlatformFFI {
|
||||
static Future<Null> init() async {
|
||||
isIOS = Platform.isIOS;
|
||||
isAndroid = Platform.isAndroid;
|
||||
isDesktop = Platform.isWindows || Platform.isMacOS || Platform.isLinux;
|
||||
if (isDesktop) {
|
||||
// TODO
|
||||
return;
|
||||
}
|
||||
final dylib = Platform.isAndroid
|
||||
? DynamicLibrary.open('librustdesk.so')
|
||||
: DynamicLibrary.process();
|
||||
|
||||
@@ -20,7 +20,7 @@ class PlatformFFI {
|
||||
|
||||
static Future<Null> init() async {
|
||||
isWeb = true;
|
||||
isDesktop = !context.callMethod('isMobile');
|
||||
isWebDesktop = !context.callMethod('isMobile');
|
||||
context.callMethod('init');
|
||||
version = getByName('version');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user