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

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

Issue 767443002: Ensure Surface size always matches window size on swap (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 | « ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ('k') | 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 2268 matching lines...) Expand 10 before | Expand all | Expand 10 after
2279 FROM_HERE, 2279 FROM_HERE,
2280 base::Bind(&HWNDMessageHandler::StopIgnoringPosChanges, 2280 base::Bind(&HWNDMessageHandler::StopIgnoringPosChanges,
2281 weak_factory_.GetWeakPtr())); 2281 weak_factory_.GetWeakPtr()));
2282 } 2282 }
2283 last_monitor_ = monitor; 2283 last_monitor_ = monitor;
2284 last_monitor_rect_ = monitor_rect; 2284 last_monitor_rect_ = monitor_rect;
2285 last_work_area_ = work_area; 2285 last_work_area_ = work_area;
2286 } 2286 }
2287 } 2287 }
2288 2288
2289 if (DidClientAreaSizeChange(window_pos)) 2289 RECT window_rect;
2290 gfx::Size old_size;
2291 if (GetWindowRect(hwnd(), &window_rect))
2292 old_size = gfx::Rect(window_rect).size();
2293 gfx::Size new_size = gfx::Size(window_pos->cx, window_pos->cy);
2294 if ((old_size != new_size && !(window_pos->flags & SWP_NOSIZE)) ||
2295 window_pos->flags & SWP_FRAMECHANGED) {
2290 delegate_->HandleWindowSizeChanging(); 2296 delegate_->HandleWindowSizeChanging();
2297 }
2291 2298
2292 if (ScopedFullscreenVisibility::IsHiddenForFullscreen(hwnd())) { 2299 if (ScopedFullscreenVisibility::IsHiddenForFullscreen(hwnd())) {
2293 // Prevent the window from being made visible if we've been asked to do so. 2300 // Prevent the window from being made visible if we've been asked to do so.
2294 // See comment in header as to why we might want this. 2301 // See comment in header as to why we might want this.
2295 window_pos->flags &= ~SWP_SHOWWINDOW; 2302 window_pos->flags &= ~SWP_SHOWWINDOW;
2296 } 2303 }
2297 2304
2298 if (window_pos->flags & SWP_SHOWWINDOW) 2305 if (window_pos->flags & SWP_SHOWWINDOW)
2299 delegate_->HandleVisibilityChanging(true); 2306 delegate_->HandleVisibilityChanging(true);
2300 else if (window_pos->flags & SWP_HIDEWINDOW) 2307 else if (window_pos->flags & SWP_HIDEWINDOW)
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
2497 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW); 2504 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_HIDEWINDOW);
2498 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW); 2505 SetWindowPos(hwnd(), NULL, 0, 0, 0, 0, flags | SWP_SHOWWINDOW);
2499 } 2506 }
2500 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want 2507 // WM_DWMCOMPOSITIONCHANGED is only sent to top level windows, however we want
2501 // to notify our children too, since we can have MDI child windows who need to 2508 // to notify our children too, since we can have MDI child windows who need to
2502 // update their appearance. 2509 // update their appearance.
2503 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL); 2510 EnumChildWindows(hwnd(), &SendDwmCompositionChanged, NULL);
2504 } 2511 }
2505 2512
2506 } // namespace views 2513 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/desktop_aura/desktop_window_tree_host_win.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698