Merge pull request #3427 from Kingtous/master

fix: linux canvas offset
This commit is contained in:
RustDesk 2023-02-28 14:01:47 +08:00 committed by GitHub
commit 6a97608b98
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -731,8 +731,15 @@ class CanvasModel with ChangeNotifier {
Size getSize() {
final size = MediaQueryData.fromWindow(ui.window).size;
// If minimized, w or h may be negative here.
double w = size.width - windowBorderWidth * 2;
double h = size.height - tabBarHeight - windowBorderWidth * 2;
double w = size.width -
windowBorderWidth * 2 -
kDragToResizeAreaPadding.left -
kDragToResizeAreaPadding.right;
double h = size.height -
tabBarHeight -
windowBorderWidth * 2 -
kDragToResizeAreaPadding.top -
kDragToResizeAreaPadding.bottom;
return Size(w < 0 ? 0 : w, h < 0 ? 0 : h);
}