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

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

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
Index: ui/views/win/hwnd_message_handler.h
diff --git a/ui/views/win/hwnd_message_handler.h b/ui/views/win/hwnd_message_handler.h
index 458addb3719ff1390d7269736485e8b3749ddc73..2569b07b3f11cc4c634e6878d4f73ebbebaf6e5b 100644
--- a/ui/views/win/hwnd_message_handler.h
+++ b/ui/views/win/hwnd_message_handler.h
@@ -59,6 +59,11 @@ class WindowsSessionChangeObserver;
const int WM_NCUAHDRAWCAPTION = 0xAE;
const int WM_NCUAHDRAWFRAME = 0xAF;
+// The HWNDMessageHandler sends this message to itself on
+// WM_WINDOWPOSCHANGING. It's used to inform the client if a
+// WM_WINDOWPOSCHANGED won't be received.
+const int WM_WINDOWSIZINGFINISHED = WM_USER;
+
// IsMsgHandled() and BEGIN_SAFE_MSG_MAP_EX are a modified version of
// BEGIN_MSG_MAP_EX. The main difference is it uses a WeakPtrFactory member
// (|weak_factory|) that is used in _ProcessWindowMessage() and changing
@@ -373,6 +378,8 @@ class VIEWS_EXPORT HWNDMessageHandler :
// Touch Events.
CR_MESSAGE_HANDLER_EX(WM_TOUCH, OnTouchEvent)
+ CR_MESSAGE_HANDLER_EX(WM_WINDOWSIZINGFINISHED, OnWindowSizingFinished)
+
// Uses the general handler macro since the specific handler macro
// MSG_WM_NCACTIVATE would convert WPARAM type to BOOL type. The high
// word of WPARAM could be set when the window is minimized or restored.
@@ -470,6 +477,7 @@ class VIEWS_EXPORT HWNDMessageHandler :
LRESULT OnTouchEvent(UINT message, WPARAM w_param, LPARAM l_param);
void OnWindowPosChanging(WINDOWPOS* window_pos);
void OnWindowPosChanged(WINDOWPOS* window_pos);
+ LRESULT OnWindowSizingFinished(UINT message, WPARAM w_param, LPARAM l_param);
// Receives Windows Session Change notifications.
void OnSessionChange(WPARAM status_code);
@@ -642,9 +650,13 @@ class VIEWS_EXPORT HWNDMessageHandler :
bool dwm_transition_desired_;
// True if HandleWindowSizeChanging has been called in the delegate, but not
- // HandleWindowSizeChanged.
+ // HandleClientSizeChanged.
bool sent_window_size_changing_;
+ // This is used to keep track of whether a WM_WINDOWPOSCHANGED has
+ // been received after the WM_WINDOWPOSCHANGING.
+ uint32_t current_window_size_message_ = 0;
+
// Manages observation of Windows Session Change messages.
std::unique_ptr<WindowsSessionChangeObserver>
windows_session_change_observer_;

Powered by Google App Engine
This is Rietveld 408576698