-
Notifications
You must be signed in to change notification settings - Fork 6k
[Windows] handle repaint message in FlutterView window #34306
Conversation
| EXPECT_CALL(delegate, OnWindowRepaint()).Times(1); | ||
|
|
||
| win32window.InjectWindowMessage(WM_PAINT, 0, 0); | ||
| } |
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.
The inject window message is really nice! 🏅
Could you also add a test that calls OnPaint directly too since it's a public API?
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.
done
bea521c to
f2b441b
Compare
loic-sharma
left a comment
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.
LGTM - thanks for fixing this!
Thanks for the review. After merging this PR, I can add another PR to change the implementation of FlutterWindowsView::ForceRedraw() to ScheduleFrame. |
stuartmorgan-g
left a comment
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.
LGTM with comment nit.
f2b441b to
010591d
Compare
|
Rebased onto latest main branch. |
|
Thanks for contributing this fix! |
This PR will fix the blank FlutterView issue by handling the repaint message in FlutterView window. Currently, WM_PAINT msg is not handled in flutter window and the default WindowProc will do nothing but paint the background. In some user cases, e.g., hide/show/min/max the app window, this can result in blank FlutterView if the content is static and there are no running animation. Addresses flutter/flutter#101339 Addresses flutter/flutter#102030
This PR will fix the blank FlutterView issue by handling the reapint message in FlutterView window.
Currently, WM_PAINT msg is not handled in flutter window and the default WindowProc will do nothing but painting the background. In some user cases, e.g., hide/show/min/max the app window, this will cause blank FlutterView described in the following 2 issues, as the framework has no knowledge of it and will not trigger a new frame if the content is static and there are no running animation.
This PR will fix:
flutter/flutter#101339
flutter/flutter#102030
Pre-launch Checklist
writing and running engine tests.
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.