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

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

Issue 1162883003: Fix Z-order for a bubble when it appears for inactive window. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DCHECK and a comment Created 5 years, 6 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.cc
diff --git a/ui/views/win/hwnd_message_handler.cc b/ui/views/win/hwnd_message_handler.cc
index 76818369d93dce38782d3d3315b9300762886c74..75d93af08e8c98c0d779150dd3d23939dbc7bf53 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -533,7 +533,10 @@ void HWNDMessageHandler::SetRegion(HRGN region) {
}
void HWNDMessageHandler::StackAbove(HWND other_hwnd) {
- SetWindowPos(hwnd(), other_hwnd, 0, 0, 0, 0,
+ // Windows API allows to stack behind another windows only.
+ DCHECK(other_hwnd);
+ HWND next_window = GetNextWindow(other_hwnd, GW_HWNDPREV);
+ SetWindowPos(hwnd(), next_window ? next_window : HWND_TOP, 0, 0, 0, 0,
SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
}

Powered by Google App Engine
This is Rietveld 408576698