This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Merge Window into FlutterWindow
#45542
Merged
Merged
Changes from 1 commit
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2983953
Add members to FlutterWindow
yaakovschectman 947d820
Remove Window parent
yaakovschectman a6b3947
Compiles
yaakovschectman b8fadb8
Passes unit tests
yaakovschectman 56273df
Cull includes
yaakovschectman 4823a50
Remove old window from BUILD
yaakovschectman a0cee80
Delete old window files
yaakovschectman 4ef1f23
Formatting
yaakovschectman 9d5e0a8
Licenses
yaakovschectman a2237e3
Reorganize members
yaakovschectman 26db6f5
PR Feedback
yaakovschectman 1b9ab60
Update shell/platform/windows/testing/mock_window.h
yaakovschectman de053cb
Privatize
yaakovschectman dbbc749
Merge branch 'main' into merge_windows
yaakovschectman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -208,6 +208,16 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| virtual void OnWindowStateEvent(WindowStateEvent event); | ||
|
|
||
| protected: | ||
| // OS callback called by message pump. Handles the WM_NCCREATE message which | ||
| // is passed when the non-client area is being created and enables automatic | ||
| // non-client DPI scaling so that the non-client area automatically | ||
| // responsponds to changes in DPI. All other messages are handled by | ||
| // MessageHandler. | ||
| static LRESULT CALLBACK WndProc(HWND const window, | ||
| UINT const message, | ||
| WPARAM const wparam, | ||
| LPARAM const lparam) noexcept; | ||
|
|
||
| // Win32's DefWindowProc. | ||
| // | ||
| // Used as the fallback behavior of HandleMessage. Exposed for dependency | ||
|
|
@@ -226,16 +236,6 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| // icon. | ||
| WNDCLASS RegisterWindowClass(std::wstring& title); | ||
|
|
||
| // OS callback called by message pump. Handles the WM_NCCREATE message which | ||
| // is passed when the non-client area is being created and enables automatic | ||
| // non-client DPI scaling so that the non-client area automatically | ||
| // responsponds to changes in DPI. All other messages are handled by | ||
| // MessageHandler. | ||
| static LRESULT CALLBACK WndProc(HWND const window, | ||
| UINT const message, | ||
| WPARAM const wparam, | ||
| LPARAM const lparam) noexcept; | ||
|
|
||
| // Processes and route salient window messages for mouse handling, | ||
| // size change and DPI. Delegates handling of these to member overloads that | ||
| // inheriting classes can handle. | ||
|
|
@@ -316,6 +316,25 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| std::unique_ptr<DirectManipulationOwner> direct_manipulation_owner_; | ||
|
|
||
| private: | ||
| // WM_DPICHANGED_BEFOREPARENT defined in more recent Windows | ||
| // SDK | ||
| const static long kWmDpiChangedBeforeParent = 0x02E2; | ||
|
|
||
| // Timer identifier for DirectManipulation gesture polling. | ||
| const static int kDirectManipulationTimer = 1; | ||
|
||
|
|
||
| // Retrieves a class instance pointer for |window| | ||
| static FlutterWindow* GetThisFromHandle(HWND const window) noexcept; | ||
|
|
||
| // Activates tracking for a "mouse leave" event. | ||
| void TrackMouseLeaveEvent(HWND hwnd); | ||
|
|
||
| // Stores new width and height and calls |OnResize| to notify inheritors | ||
| void HandleResize(UINT width, UINT height); | ||
|
|
||
| // Updates the cached scroll_offset_multiplier_ value based off OS settings. | ||
| void UpdateScrollOffsetMultiplier(); | ||
|
|
||
| // A pointer to a FlutterWindowsView that can be used to update engine | ||
| // windowing and input state. | ||
| WindowBindingHandlerDelegate* binding_handler_delegate_; | ||
|
|
@@ -331,17 +350,6 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| // proper application lifecycle state can be updated once the view is set. | ||
| bool restored_ = false; | ||
| bool focused_ = false; | ||
| // Activates tracking for a "mouse leave" event. | ||
| void TrackMouseLeaveEvent(HWND hwnd); | ||
|
|
||
| // Stores new width and height and calls |OnResize| to notify inheritors | ||
| void HandleResize(UINT width, UINT height); | ||
|
|
||
| // Retrieves a class instance pointer for |window| | ||
| static FlutterWindow* GetThisFromHandle(HWND const window) noexcept; | ||
|
|
||
| // Updates the cached scroll_offset_multiplier_ value based off OS settings. | ||
| void UpdateScrollOffsetMultiplier(); | ||
|
|
||
| int current_dpi_ = 0; | ||
| int current_width_ = 0; | ||
|
|
@@ -350,10 +358,6 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| // Holds the conversion factor from lines scrolled to pixels scrolled. | ||
| float scroll_offset_multiplier_; | ||
|
|
||
| // WM_DPICHANGED_BEFOREPARENT defined in more recent Windows | ||
| // SDK | ||
| const static long kWmDpiChangedBeforeParent = 0x02E2; | ||
|
|
||
| // Member variable to hold window handle. | ||
| HWND window_handle_ = nullptr; | ||
|
|
||
|
|
@@ -371,6 +375,9 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| double mouse_x_ = 0; | ||
| double mouse_y_ = 0; | ||
|
|
||
| // Generates touch point IDs for touch events. | ||
| SequentialIdGenerator touch_id_generator_; | ||
|
|
||
| // Abstracts Windows APIs that may not be available on all supported versions | ||
| // of Windows. | ||
| std::unique_ptr<WindowsProcTable> windows_proc_table_; | ||
|
|
@@ -384,12 +391,6 @@ class FlutterWindow : public KeyboardManager::WindowDelegate, | |
| // Used for temporarily storing the WM_TOUCH-provided touch points. | ||
| std::vector<TOUCHINPUT> touch_points_; | ||
|
|
||
| // Generates touch point IDs for touch events. | ||
| SequentialIdGenerator touch_id_generator_; | ||
|
|
||
| // Timer identifier for DirectManipulation gesture polling. | ||
| const static int kDirectManipulationTimer = 1; | ||
|
|
||
| // Implements IRawElementProviderFragmentRoot when UIA is enabled. | ||
| std::unique_ptr<ui::AXFragmentRootWin> ax_fragment_root_; | ||
|
|
||
|
|
||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you do a pass on
protectedmembers to check if they can be madeprivateinstead? It looks likeRegisterWindowClassshould be private, there may be more.