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

Side by Side Diff: ui/views/win/hwnd_message_handler.cc

Issue 792303002: [Win] Fix detection of normal windows in HWNDMessageHandler::OnSizeConstraintsChanged. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/win/hwnd_message_handler.h" 5 #include "ui/views/win/hwnd_message_handler.h"
6 6
7 #include <dwmapi.h> 7 #include <dwmapi.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #include <wtsapi32.h> 10 #include <wtsapi32.h>
(...skipping 861 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 fullscreen_handler()->SetFullscreen(fullscreen); 872 fullscreen_handler()->SetFullscreen(fullscreen);
873 // If we are out of fullscreen and there was a pending DWM transition for the 873 // If we are out of fullscreen and there was a pending DWM transition for the
874 // window, then go ahead and do it now. 874 // window, then go ahead and do it now.
875 if (!fullscreen && dwm_transition_desired_) 875 if (!fullscreen && dwm_transition_desired_)
876 PerformDwmTransition(); 876 PerformDwmTransition();
877 } 877 }
878 878
879 void HWNDMessageHandler::SizeConstraintsChanged() { 879 void HWNDMessageHandler::SizeConstraintsChanged() {
880 LONG style = GetWindowLong(hwnd(), GWL_STYLE); 880 LONG style = GetWindowLong(hwnd(), GWL_STYLE);
881 // Ignore if this is not a standard window. 881 // Ignore if this is not a standard window.
882 // WS_OVERLAPPED is just the *absence* of WS_POPUP and WS_CHILD. 882 if (style & (WS_POPUP | WS_CHILD))
883 if ((style & (WS_POPUP | WS_CHILD)) == WS_OVERLAPPED)
884 return; 883 return;
885 884
886 LONG exstyle = GetWindowLong(hwnd(), GWL_EXSTYLE); 885 LONG exstyle = GetWindowLong(hwnd(), GWL_EXSTYLE);
887 // Windows cannot have WS_THICKFRAME set if WS_EX_COMPOSITED is set. 886 // Windows cannot have WS_THICKFRAME set if WS_EX_COMPOSITED is set.
888 // See CalculateWindowStylesFromInitParams(). 887 // See CalculateWindowStylesFromInitParams().
889 if (delegate_->CanResize() && (exstyle & WS_EX_COMPOSITED) == 0) { 888 if (delegate_->CanResize() && (exstyle & WS_EX_COMPOSITED) == 0) {
890 style |= WS_THICKFRAME | WS_MAXIMIZEBOX; 889 style |= WS_THICKFRAME | WS_MAXIMIZEBOX;
891 if (!delegate_->CanMaximize()) 890 if (!delegate_->CanMaximize())
892 style &= ~WS_MAXIMIZEBOX; 891 style &= ~WS_MAXIMIZEBOX;
893 } else { 892 } else {
(...skipping 1618 matching lines...) Expand 10 before | Expand all | Expand 10 after
2512 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); 2511 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW);
2513 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); 2512 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW);
2514 } 2513 }
2515 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want 2514 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want
2516 // to notify our children too, since we can have MDI child windows who need to 2515 // to notify our children too, since we can have MDI child windows who need to
2517 // update their appearance. 2516 // update their appearance.
2518 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); 2517 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL);
2519 } 2518 }
2520 2519
2521 } // namespace views 2520 } // namespace views
OLDNEW
« 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