diff --git a/example/linux/flutter/generated_plugins.cmake b/example/linux/flutter/generated_plugins.cmake index ff9859b..ec93390 100644 --- a/example/linux/flutter/generated_plugins.cmake +++ b/example/linux/flutter/generated_plugins.cmake @@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST screen_retriever ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -15,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/linux plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/example/pubspec.lock b/example/pubspec.lock index e6496cb..ea7787d 100644 --- a/example/pubspec.lock +++ b/example/pubspec.lock @@ -49,7 +49,7 @@ packages: name: collection url: "https://pub.dartlang.org" source: hosted - version: "1.15.0" + version: "1.16.0" crypto: dependency: transitive description: @@ -70,7 +70,7 @@ packages: name: fake_async url: "https://pub.dartlang.org" source: hosted - version: "1.2.0" + version: "1.3.0" flutter: dependency: "direct main" description: flutter @@ -99,7 +99,7 @@ packages: name: js url: "https://pub.dartlang.org" source: hosted - version: "0.6.3" + version: "0.6.4" matcher: dependency: transitive description: @@ -113,7 +113,7 @@ packages: name: material_color_utilities url: "https://pub.dartlang.org" source: hosted - version: "0.1.3" + version: "0.1.4" meta: dependency: transitive description: @@ -127,7 +127,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.8.0" + version: "1.8.1" preference_list: dependency: "direct main" description: @@ -153,7 +153,7 @@ packages: name: source_span url: "https://pub.dartlang.org" source: hosted - version: "1.8.1" + version: "1.8.2" stack_trace: dependency: transitive description: @@ -188,7 +188,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.4.8" + version: "0.4.9" typed_data: dependency: transitive description: @@ -209,7 +209,7 @@ packages: name: vector_math url: "https://pub.dartlang.org" source: hosted - version: "2.1.1" + version: "2.1.2" sdks: - dart: ">=2.14.0 <3.0.0" + dart: ">=2.17.0-0 <3.0.0" flutter: ">=1.20.0" diff --git a/example/windows/flutter/generated_plugins.cmake b/example/windows/flutter/generated_plugins.cmake index 475de51..2795695 100644 --- a/example/windows/flutter/generated_plugins.cmake +++ b/example/windows/flutter/generated_plugins.cmake @@ -7,6 +7,9 @@ list(APPEND FLUTTER_PLUGIN_LIST screen_retriever ) +list(APPEND FLUTTER_FFI_PLUGIN_LIST +) + set(PLUGIN_BUNDLED_LIBRARIES) foreach(plugin ${FLUTTER_PLUGIN_LIST}) @@ -15,3 +18,8 @@ foreach(plugin ${FLUTTER_PLUGIN_LIST}) list(APPEND PLUGIN_BUNDLED_LIBRARIES $) list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${plugin}_bundled_libraries}) endforeach(plugin) + +foreach(ffi_plugin ${FLUTTER_FFI_PLUGIN_LIST}) + add_subdirectory(flutter/ephemeral/.plugin_symlinks/${ffi_plugin}/windows plugins/${ffi_plugin}) + list(APPEND PLUGIN_BUNDLED_LIBRARIES ${${ffi_plugin}_bundled_libraries}) +endforeach(ffi_plugin) diff --git a/windows/screen_retriever_plugin.cpp b/windows/screen_retriever_plugin.cpp index e7f4ab1..5acda1c 100644 --- a/windows/screen_retriever_plugin.cpp +++ b/windows/screen_retriever_plugin.cpp @@ -96,20 +96,22 @@ flutter::EncodableMap MonitorToEncodableMap(HMONITOR monitor) { double scale_factor = dpi / kBaseDpi; - double visibleWidth = (info.rcWork.right - info.rcWork.left); - double visibleHeight = (info.rcWork.bottom - info.rcWork.top); + double visibleWidth = + round((info.rcWork.right - info.rcWork.left) / scale_factor); + double visibleHeight = + round((info.rcWork.bottom - info.rcWork.top) / scale_factor); - double visibleX = (info.rcWork.left); - double visibleY = (info.rcWork.top); + double visibleX = round((info.rcWork.left) / scale_factor); + double visibleY = round((info.rcWork.top) / scale_factor); flutter::EncodableMap size = flutter::EncodableMap(); flutter::EncodableMap visibleSize = flutter::EncodableMap(); flutter::EncodableMap visiblePosition = flutter::EncodableMap(); - size[flutter::EncodableValue("width")] = - flutter::EncodableValue(static_cast(info.rcMonitor.right)); - size[flutter::EncodableValue("height")] = - flutter::EncodableValue(static_cast(info.rcMonitor.bottom)); + size[flutter::EncodableValue("width")] = flutter::EncodableValue( + static_cast(round(info.rcMonitor.right / scale_factor))); + size[flutter::EncodableValue("height")] = flutter::EncodableValue( + static_cast(round(info.rcMonitor.bottom / scale_factor))); visibleSize[flutter::EncodableValue("width")] = flutter::EncodableValue(visibleWidth);