Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Unified Diff: ui/views/win/hwnd_message_handler.cc

Issue 1811913007: Fix window drawing after snap on Windows 10. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix signedness Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/win/hwnd_message_handler.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 4366e51b39828282a332db917202edc298f8b6bb..9b40b5089d88dca57f1a446cb805ed2431a6d7e1 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -1103,6 +1103,9 @@ void HWNDMessageHandler::ClientAreaSizeChanged() {
return;
gfx::Size s = GetClientAreaBounds().size();
delegate_->HandleClientSizeChanged(s);
+
+ current_window_size_message_++;
+ sent_window_size_changing_ = false;
}
bool HWNDMessageHandler::GetClientAreaInsets(gfx::Insets* insets) const {
@@ -2274,6 +2277,12 @@ void HWNDMessageHandler::OnWindowPosChanging(WINDOWPOS* window_pos) {
window_pos->flags & SWP_FRAMECHANGED) {
delegate_->HandleWindowSizeChanging();
sent_window_size_changing_ = true;
+
+ // It's possible that if Aero snap is being entered then the window size
+ // won't actually change. Post a message to ensure swaps will be re-enabled
+ // in that case.
+ PostMessage(hwnd(), WM_WINDOWSIZINGFINISHED, ++current_window_size_message_,
+ 0);
}
if (ScopedFullscreenVisibility::IsHiddenForFullscreen(hwnd())) {
@@ -2307,13 +2316,24 @@ void HWNDMessageHandler::OnWindowPosChanged(WINDOWPOS* window_pos) {
if (direct_manipulation_helper_)
direct_manipulation_helper_->Deactivate(hwnd());
}
- if (sent_window_size_changing_) {
- sent_window_size_changing_ = false;
- delegate_->HandleWindowSizeChanged();
- }
+
SetMsgHandled(FALSE);
}
+LRESULT HWNDMessageHandler::OnWindowSizingFinished(UINT message,
+ WPARAM w_param,
+ LPARAM l_param) {
+ // Check if a newer WM_WINDOWPOSCHANGING or WM_WINDOWPOSCHANGED have been
+ // received after this message was posted.
+ if (current_window_size_message_ != w_param)
+ return 0;
+
+ delegate_->HandleWindowSizeUnchanged();
+ sent_window_size_changing_ = false;
+
sky 2016/08/01 15:30:09 SetMsgHanded(FALSE)?
+ return 0;
+}
+
void HWNDMessageHandler::OnSessionChange(WPARAM status_code) {
// Direct3D presents are ignored while the screen is locked, so force the
// window to be redrawn on unlock.
« no previous file with comments | « ui/views/win/hwnd_message_handler.h ('k') | ui/views/win/hwnd_message_handler_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698