diff --git a/flutter/lib/desktop/pages/remote_page.dart b/flutter/lib/desktop/pages/remote_page.dart index c03c2f3d4..96ade40f4 100644 --- a/flutter/lib/desktop/pages/remote_page.dart +++ b/flutter/lib/desktop/pages/remote_page.dart @@ -537,8 +537,17 @@ class ImagePaint extends StatelessWidget { Widget build(BuildContext context) { final m = Provider.of(context); var c = Provider.of(context); - final s = c.scale; + + mouseRegion({child}) => Obx(() => MouseRegion( + cursor: (cursorOverImage.isTrue && keyboardEnabled.isTrue) + ? (remoteCursorMoved.isTrue + ? SystemMouseCursors.none + : _buildCustomCursorLinux(context, s)) + : MouseCursor.defer, + onHover: (evt) {}, + child: child)); + if (c.scrollStyle == ScrollStyle.scrollbar) { final imageWidget = SizedBox( width: c.getDisplayWidth() * s, @@ -547,7 +556,6 @@ class ImagePaint extends StatelessWidget { painter: ImagePainter(image: m.image, x: 0, y: 0, scale: s), )); - Rx pos = Rx(const Offset(0.0, 0.0)); return Center( child: NotificationListener( onNotification: (notification) { @@ -562,16 +570,8 @@ class ImagePaint extends StatelessWidget { c.setScrollPercent(percentX, percentY); return false; }, - child: Obx(() => MouseRegion( - cursor: (cursorOverImage.isTrue && keyboardEnabled.isTrue) - ? (remoteCursorMoved.isTrue - ? SystemMouseCursors.none - : _buildCustomCursorLinux(context, s)) - : MouseCursor.defer, - onHover: (evt) { - pos.value = evt.position; - }, - child: _buildCrossScrollbar(_buildListener(imageWidget)))), + child: mouseRegion( + child: _buildCrossScrollbar(_buildListener(imageWidget))), ), ); } else { @@ -582,7 +582,7 @@ class ImagePaint extends StatelessWidget { painter: ImagePainter(image: m.image, x: c.x / s, y: c.y / s, scale: s), )); - return _buildListener(imageWidget); + return mouseRegion(child: _buildListener(imageWidget)); } } @@ -594,6 +594,8 @@ class ImagePaint extends StatelessWidget { } else { final key = cacheLinux.key(scale); cursor.addKeyLinux(key); + // debugPrint( + // 'REMOVE ME ================================= linux curor key: $key'); return FlutterCustomMemoryImageCursor( pixbuf: cacheLinux.data, key: key, diff --git a/flutter/lib/desktop/widgets/popup_menu.dart b/flutter/lib/desktop/widgets/popup_menu.dart index 02376ff71..3814561ee 100644 --- a/flutter/lib/desktop/widgets/popup_menu.dart +++ b/flutter/lib/desktop/widgets/popup_menu.dart @@ -8,7 +8,7 @@ import './material_mod_popup_menu.dart' as mod_menu; // https://stackoverflow.com/questions/68318314/flutter-popup-menu-inside-popup-menu class PopupMenuChildrenItem extends mod_menu.PopupMenuEntry { - PopupMenuChildrenItem({ + const PopupMenuChildrenItem({ key, this.height = kMinInteractiveDimension, this.padding,