summaryrefslogtreecommitdiffstats
path: root/chrome/views
diff options
context:
space:
mode:
authorben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 19:41:55 +0000
committerben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-26 19:41:55 +0000
commit77100057597b3c7ccf8d284979b3de88e6a93365 (patch)
treebe5cb2346a02da5ae33c6589f8c1516614b06ccc /chrome/views
parent16e1cb0d2b0106b6aa6008581dac19d7db9283a6 (diff)
downloadchromium_src-77100057597b3c7ccf8d284979b3de88e6a93365.zip
chromium_src-77100057597b3c7ccf8d284979b3de88e6a93365.tar.gz
chromium_src-77100057597b3c7ccf8d284979b3de88e6a93365.tar.bz2
Makes it so windows opened from links in Windows Live Messenger cause the window to appear instead of being invisible.
The discovery is that Windows enforces that you call ShowWindow with the value of STARTUPINFO's wShowWindow field first before calling it with any other value, otherwise all subsequent calls are ignored. I used to have code that flattened the return value of a function into something that would ensure the window is visible, but what I actually needed to do was show the window twice in this case. Ick. http://crbug.com/3126 TEST=Have someone send you a link in a Windows Live Messenger window, click it without Chrome running (Chrome must be default browser), and a Chrome window should appear, visible, loading the link. Also try running chrome.exe from bash to make sure that still works. Review URL: http://codereview.chromium.org/27190 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10502 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/views')
-rw-r--r--chrome/views/window.cc9
1 files changed, 8 insertions, 1 deletions
diff --git a/chrome/views/window.cc b/chrome/views/window.cc
index 1b74a41..ad18fab 100644
--- a/chrome/views/window.cc
+++ b/chrome/views/window.cc
@@ -83,7 +83,6 @@ gfx::Size Window::CalculateMaximumSize() const {
void Window::Show() {
int show_state = GetShowState();
- bool maximized = false;
if (saved_maximized_state_)
show_state = SW_SHOWMAXIMIZED;
Show(show_state);
@@ -91,6 +90,14 @@ void Window::Show() {
void Window::Show(int show_state) {
ShowWindow(show_state);
+ // When launched from certain programs like bash and Windows Live Messenger,
+ // show_state is set to SW_HIDE, so we need to correct that condition. We
+ // don't just change show_state to SW_SHOWNORMAL because MSDN says we must
+ // always first call ShowWindow with the specified value from STARTUPINFO,
+ // otherwise all future ShowWindow calls will be ignored (!!#@@#!). Instead,
+ // we call ShowWindow again in this case.
+ if (show_state == SW_HIDE)
+ ShowWindow(SW_SHOWNORMAL);
SetInitialFocus();
}