Merge Window into FlutterWindow#45542
Conversation
cbracken
left a comment
There was a problem hiding this comment.
Making the assumption that other than signatures being merged, the implementation details haven't changed in the bulk of this code.
Just a few quick initial comments.
| void HandleResize(UINT width, UINT height); | ||
|
|
||
| // Retrieves a class instance pointer for |window| | ||
| static FlutterWindow* GetThisFromHandle(HWND const window) noexcept; |
There was a problem hiding this comment.
style nit: We should consider gathering the static class methods together at the top of each public/protected/private section.
|
|
||
| int current_dpi_ = 0; | ||
| int current_width_ = 0; | ||
| int current_height_ = 0; |
There was a problem hiding this comment.
We should order members in sections. I'll check the style guide but my recollection is: statics, regular methods, fields. Just make sure we keep fields ordered the same as constructor field initialisation to avoid undefined behaviour.
| // input. | ||
| // See | ||
| // https://docs.microsoft.com/en-us/windows/win32/tablet/system-events-and-mouse-messages?redirectedfrom=MSDN#distinguishing-pen-input-from-mouse-and-touch. | ||
| static FlutterPointerDeviceKind GetFlutterPointerDeviceKind() { |
There was a problem hiding this comment.
nit: For static functions (as opposed to class methods), for conistency, we should probably move these to the anonymous namespace instead of old-school static.
| const static long kWmDpiChangedBeforeParent = 0x02E2; | ||
|
|
||
| // Timer identifier for DirectManipulation gesture polling. | ||
| const static int kDirectManipulationTimer = 1; |
There was a problem hiding this comment.
Here and above, while you're in here, let's also switch these to static const for consistency with elsewhere.
|
Haven't really compared the merged files line by line. Are there any lines worth checking? If not, it looks good to me. :) |
There's nothing that's really new code. Just existing code moved to new places and some type names updated to reflect that. |
|
|
||
| /// Mock for the |Window| base class. | ||
| class MockWindow : public Window { | ||
| class MockWindow : public FlutterWindow { |
There was a problem hiding this comment.
Consider renaming this type to MockFlutterWindow and this file to mock_flutter_window. I don't feel strongly about this though.
|
|
||
| // Registers a window class with default style attributes, cursor and | ||
| // icon. | ||
| WNDCLASS RegisterWindowClass(std::wstring& title); |
There was a problem hiding this comment.
Could you do a pass on protected members to check if they can be made private instead? It looks like RegisterWindowClass should be private, there may be more.
loic-sharma
left a comment
There was a problem hiding this comment.
LGTM, thanks for cleaning this up!
Co-authored-by: Loïc Sharma <737941+loic-sharma@users.noreply.github.com>
flutter/engine@06696e7...8389ad9 2023-09-11 109111084+yaakovschectman@users.noreply.github.com Merge `Window` into `FlutterWindow` (flutter/engine#45542) 2023-09-11 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from 7Zk_dvFh301kgQte4... to fSmVaZwp41ZGp5hKn... (flutter/engine#45665) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from 7Zk_dvFh301k to fSmVaZwp41ZG If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md

Merge abstract base class
Windowinto concrete derived classFlutterWindowto simplify future development.flutter/flutter#132260
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.