summaryrefslogtreecommitdiffstats
path: root/chrome/views/widget_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/widget_win.cc')
-rw-r--r--chrome/views/widget_win.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/chrome/views/widget_win.cc b/chrome/views/widget_win.cc
index fea61da..9568a64 100644
--- a/chrome/views/widget_win.cc
+++ b/chrome/views/widget_win.cc
@@ -241,7 +241,13 @@ void WidgetWin::MoveToFront(bool should_activate) {
if (!should_activate) {
flags |= SWP_NOACTIVATE;
}
- SetWindowPos(HWND_NOTOPMOST, 0, 0, 0, 0, flags);
+
+ // Keep the window topmost if it was already topmost.
+ WINDOWINFO wi;
+ wi.cbSize = sizeof WINDOWINFO;
+ GetWindowInfo(GetHWND(), &wi);
+ SetWindowPos((wi.dwExStyle & WS_EX_TOPMOST) ? HWND_TOPMOST : HWND_NOTOPMOST,
+ 0, 0, 0, 0, flags);
}
HWND WidgetWin::GetHWND() const {