Skip to content

[UWP] App has extra 1x1 offset and root widget is not shown fully #87785

@moko256

Description

@moko256

On UWP, app has extra 1x1 offset that is different from window border and root widget is not shown fully.

Steps to Reproduce

I created 1px red rectangle in widget root inner, and 1px green rectangle in that rectangle inner.

  1. Run flutter create --platforms=windows,winuwp,web one_border.
  2. Write lib/main.dart as follows:
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      decoration: BoxDecoration(border: Border.all(color: Colors.red)),
      child: Container(
        decoration: BoxDecoration(border: Border.all(color: Colors.green)),
      ),
    );
  }
}

Screenshots (I does not set background. The background blue is UWP primary color):

screenshot left-top (viewing in MS Paint) right-bottom (viewing in MS Paint)
win32 (what I expected behavior) one_px_border_win32 one_px_border_win32_0_0 one_px_border_win32_1_1
winuwp (the actual behavior) one_px_border_winuwp one_px_border_winuwp_0_0 one_px_border_winuwp_1_1

Expected results:
On UWP, the red rectangle in the widget root inner is visible.

Actual results:
On UWP, the red rectangle is not visible fully and only the green rectangle in that rectangle inner is visible.

Logs
Analyzing one_border...
No issues found! (ran in 1.9s)
[✓] Flutter (Channel master, 2.5.0-6.0.pre.21, on Microsoft Windows [Version 10.0.19043.1151], locale ja-JP)
    • Flutter version 2.5.0-6.0.pre.21 at C:\Users\moko256\softwares\flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision 40e8620a27 (4 hours ago), 2021-08-06 09:14:50 +0430
    • Engine revision 431ac604da
    • Dart version 2.14.0 (build 2.14.0-383.0.dev)

[✗] Android toolchain - develop for Android devices
    ✗ Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.


[✓] Chrome - develop for the web
    • Chrome at C:\Program Files\Google\Chrome\Application\chrome.exe

[✓] Visual Studio - develop for Windows (Visual Studio Community 2019 16.10.3)
    • Visual Studio at C:\Program Files (x86)\Microsoft Visual Studio\2019\Community
    • Visual Studio Community 2019 version 16.10.31424.327
    • Windows 10 SDK version 10.0.19041.0

[!] Android Studio (not installed)
    • Android Studio not found; download from https://developer.android.com/studio/index.html
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).

[✓] VS Code, 64-bit edition (version 1.59.0)
    • VS Code at C:\Program Files\Microsoft VS Code
    • Flutter extension version 3.24.0

[✓] Connected device (4 available)
    • Windows (desktop)       • windows • windows-x64     • Microsoft Windows [Version 10.0.19043.1151]
    • Windows (UWP) (desktop) • winuwp  • windows-uwp-x64 •
    • Chrome (web)            • chrome  • web-javascript  • Google Chrome 92.0.4515.131
    • Edge (web)              • edge    • web-javascript  • Microsoft Edge 92.0.902.62

! Doctor found issues in 2 categories.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: desktopRunning on desktopengineflutter/engine repository. See also e: labels.found in release: 2.5Found to occur in 2.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-windowsBuilding on or for Windows specificallywaiting for PR to land (fixed)A fix is in flight

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions