Commit Graph

16 Commits

Author SHA1 Message Date
Chris Bracken
a34086a573
[Windows] Drop support for Windows 7/8 apps in template (#146668)
Since Flutter no longer supports Windows 7.x or 8.x, this eliminates support from the Windows app template. No tests to eliminate, since Windows 7 and 8 were "best-efforts" tier and untested.

Fixes: https://github.com/flutter/flutter/issues/140830
RFC: http://flutter.dev/go/flutter-drop-win7-2024
2024-04-12 01:07:20 +00:00
Chris Bracken
9f8fe3f04c
[Windows] Fix signed/unsigned int comparison (#142341)
Previously, we were comparing the signed int `target_length` (returned by WideCharToMultiByte) to a size_t string length, resulting in a signed/unsigned comparison warning as follows:

```
windows\runner\utils.cpp(54,43): warning C4018:  '>': signed/unsigned mismatch
```

WideCharToMultiByte returns:
* 0 on error
* the number of bytes written to the buffer pointed to by its fifth parameter, lpMultiByteStr, on success.

As a result it's safe to store the return value in an unsigned int, which eliminates the warning.

No changes to tests since this is dependent on end-user project settings/modifications and does not trigger a warning with default project settings.

Fixes: https://github.com/flutter/flutter/issues/134227
2024-02-07 00:09:57 +00:00
Pierrick Bouvier
792e26df95
[Windows] Add target architecture to build path (#131843)
To implement windows-arm64 support, it is needed to add architecture as a subdirectory (https://github.com/flutter/flutter/issues/129805).

In short, when performing a flutter windows build, we have:
- Before: build/windows/runner/Release/gallery.exe
- After: build/windows/x64/runner/Release/gallery.exe

This convention follows what flutter linux build does.

Addresses: https://github.com/flutter/flutter/issues/129805
Addresses: https://github.com/flutter/flutter/issues/116196

Design doc: [flutter.dev/go/windows-arm64](https://flutter.dev/go/windows-arm64)
2023-08-31 09:09:02 -07:00
lsaudon
7cab354def
Deletes files that should be ignored (#127984)
Some files are supposed to ignore, but don't.

- **/windows/flutter/generated_plugins.cmake
- **/linux/flutter/generated_plugin_registrant.cc
- **/linux/flutter/generated_plugin_registrant.h
- **/linux/flutter/generated_plugins.cmake
- **/windows/flutter/generated_plugin_registrant.cc
- **/windows/flutter/generated_plugin_registrant.h
- **/ios/Runner/GeneratedPluginRegistrant.h
- **/ios/Runner/GeneratedPluginRegistrant.m

*List which issues are fixed by this PR. You must list at least one issue.*

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
2023-06-29 19:45:22 +00:00
Loïc Sharma
071ea49248
[Windows] Address feedback for show window comment (#127998)
Address Tong's feedback here: https://github.com/flutter/flutter/issues/127695#issuecomment-1564884872

Follow-up to: https://github.com/flutter/flutter/pull/127046
2023-05-31 23:42:54 +00:00
Loïc Sharma
ce61eda70c
[Windows] Ensure window is shown (#127046)
## Background

The Windows runner has a race at startup:

1. **Platform thread**: creates a hidden window
2. **Platform thread**: launches the Flutter engine
3. **UI/Raster threads**: renders the first frame
4. **Platform thread**: Registers a callback to show the window once the next frame has been rendered.

Steps 3 and 4 happen in parallel and it is possible for step 3 to complete before step 4 starts. In this scenario, the next frame callback is never called and the window is never shown.

As a result the `windows_startup_test`'s test, which [verifies that the "show window" callback is called](1f09a8662d/dev/integration_tests/windows_startup_test/windows/runner/flutter_window.cpp (L60-L64)), can flake if the first frame is rendered before the show window callback has been registered.

## Solution

This change makes the runner schedule a frame after it registers the next frame callback. If step 3 hasn't completed yet, this no-ops as a frame is already scheduled. If step 3 has already completed, a new frame will be rendered, which will call the next frame callback and show the window.

Part of https://github.com/flutter/flutter/issues/119415

See this thread for alternatives that were considered: https://github.com/flutter/engine/pull/42061#issuecomment-1550080722
2023-05-19 22:25:55 +00:00
yaakovschectman
7d37f2a616
Opt into CMake policy CMP0135 (#125502)
~Update the windows app template and migration to use `CMP0135` when
cmake version is >= 3.24.~

Update app templates' and examples' CMakeLists.txt to use
`cmake_policy(VERSION`. https://github.com/flutter/packages/pull/3828
should obviate the need for a migration.

Addresses https://github.com/flutter/flutter/issues/116866

## Pre-launch Checklist

- [x] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [x] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [x] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [x] I listed at least one issue that this PR fixes in the description
above.
- [x] I updated/added relevant documentation (doc comments with `///`).
- [x] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [x] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#features-we-expect-every-widget-to-implement
[CLA]: https://cla.developers.google.com/
[flutter/tests]: https://github.com/flutter/tests
[breaking change policy]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
2023-04-28 17:49:54 -04:00
Lioness100
26b6c1bedd
Fix typos (#121171)
* Fix typos

* lowercase animated & opacity

* Undo typo fix

---------

Co-authored-by: Michael Goderbauer <goderbauer@google.com>
2023-02-23 19:43:21 +00:00
Tomasz Gucio
98576cef58
Avoid null terminating characters in strings from Utf8FromUtf16() (#109729)
---------
Co-authored-by: schectman <schectman@google.com>
2023-02-13 19:22:37 +01:00
yaakovschectman
455e6aca50
Test integration test apps' runner files against current template app (#118646)
* Create template file test

* Add to .ci.yaml

* Add to TESTOWNERS

* Organize test script

* Push license to top of file

* Equals sign

* Utilize path.join

* Expand error message

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Fix missing newline string

* Move template file test to analyze.dart

* Fix newline

* Var name

* Fix extension length

* Use ignore-list for filenames

* Update dev/bots/analyze.dart

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>

* Indentation

Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
2023-01-24 17:00:22 -05:00
yaakovschectman
5e50ed972b
Test Utf8FromUtf16 (#118647) 2023-01-23 16:07:55 -05:00
Loïc Sharma
22f3b4edf5
[Windows] Use dark title bar on dark system theme (#111042) 2022-09-09 22:23:59 +00:00
Jenn Magder
c075ef058c
Revert "[Windows] Use dark title bar on dark system theme" (#110890) 2022-09-03 00:18:34 +00:00
Loïc Sharma
2fb5b2729a
[Windows] Use dark title bar on dark system theme (#110615) 2022-09-02 23:15:12 +00:00
Loïc Sharma
c60cf97c19
[Windows] Hide app until first frame is drawn (#109816) 2022-08-30 14:26:21 +00:00
Loïc Sharma
4898f1f5c5
[Windows] Add app startup integration test (#110114)
Add a basic integration test for the Windows's app startup. In a subsequent change (https://github.com/flutter/flutter/pull/109816), this test will be updated to verify the app's window isn't visible until after the first frame has been drawn.

Part of https://github.com/flutter/flutter/issues/41980
2022-08-25 18:54:20 -07:00