mirror of
https://github.com/weyne85/rustdesk.git
synced 2025-10-29 17:00:05 +00:00
show disabled cursor on the control end
Signed-off-by: 21pages <pages21@163.com>
This commit is contained in:
@@ -280,10 +280,12 @@ class ImagePaint extends StatelessWidget {
|
||||
final s = c.scale;
|
||||
|
||||
mouseRegion({child}) => Obx(() => MouseRegion(
|
||||
cursor: (cursorOverImage.isTrue && keyboardEnabled.isTrue)
|
||||
? (remoteCursorMoved.isTrue
|
||||
? SystemMouseCursors.none
|
||||
: _buildCustomCursorLinux(context, s))
|
||||
cursor: cursorOverImage.isTrue
|
||||
? keyboardEnabled.isTrue
|
||||
? (remoteCursorMoved.isTrue
|
||||
? SystemMouseCursors.none
|
||||
: _buildCustomCursorLinux(context, s))
|
||||
: _buildDisabledCursor(context, s)
|
||||
: MouseCursor.defer,
|
||||
onHover: (evt) {},
|
||||
child: child));
|
||||
@@ -350,6 +352,28 @@ class ImagePaint extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
MouseCursor _buildDisabledCursor(BuildContext context, double scale) {
|
||||
final cursor = Provider.of<CursorModel>(context);
|
||||
final cacheLinux = cursor.cacheLinux;
|
||||
if (cacheLinux == null) {
|
||||
return MouseCursor.defer;
|
||||
} else {
|
||||
if (cursor.cachedForbidmemoryCursorData == null) {
|
||||
cursor.updateForbiddenCursorBuffer();
|
||||
}
|
||||
final key = 'disabled_cursor_key';
|
||||
cursor.addKeyLinux(key);
|
||||
return FlutterCustomMemoryImageCursor(
|
||||
pixbuf: cursor.cachedForbidmemoryCursorData,
|
||||
key: key,
|
||||
hotx: cacheLinux.hotx,
|
||||
hoty: cacheLinux.hoty,
|
||||
imageWidth: 32,
|
||||
imageHeight: 32,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Widget _buildCrossScrollbarFromLayout(
|
||||
BuildContext context, Widget child, Size layoutSize, Size size) {
|
||||
final scrollConfig = CustomMouseWheelScrollConfig(
|
||||
|
||||
Reference in New Issue
Block a user