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

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

Issue 725953002: Make sure new maximized window gets activated (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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 | « no previous file | no next file » | 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 49ccb977a5e906e229dace0237cf90072539ed8a..8f5d189d3f02e13646f653a4be02caec7851597e 100644
--- a/ui/views/win/hwnd_message_handler.cc
+++ b/ui/views/win/hwnd_message_handler.cc
@@ -598,6 +598,9 @@ void HWNDMessageHandler::ShowWindowWithState(ui::WindowShowState show_state) {
case ui::SHOW_STATE_MINIMIZED:
native_show_state = SW_SHOWMINIMIZED;
break;
+ case ui::SHOW_STATE_NORMAL:
+ native_show_state = SW_SHOWNORMAL;
+ break;
default:
native_show_state = delegate_->GetInitialShowState();
break;
@@ -633,6 +636,11 @@ void HWNDMessageHandler::ShowMaximizedWithBounds(const gfx::Rect& bounds) {
placement.showCmd = SW_SHOWMAXIMIZED;
placement.rcNormalPosition = bounds.ToRECT();
SetWindowPlacement(hwnd(), &placement);
+
+ // We need to explicitly activate the window, because if we're opened from a
+ // desktop shortcut while an existing window is already running it doesn't
+ // seem to be enough to use SW_SHOWMAXIMIZED to activate the window.
+ Activate();
sky 2014/11/24 16:23:07 I think you're working around a problem that may b
Tomasz Moniuszko 2014/11/27 15:35:50 No it doesn't because Activate() is being called f
sky 2014/12/01 17:11:45 Ah, ok, I get it.
}
void HWNDMessageHandler::Hide() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698