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

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

Issue 2753813003: Fix theme change paint issue on linux. (Closed)
Patch Set: Created 3 years, 9 months 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/widget.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 <tchar.h> 10 #include <tchar.h>
(...skipping 809 matching lines...) Expand 10 before | Expand all | Expand 10 after
820 base::win::ScopedHICON previous_icon = std::move(app_icon_); 820 base::win::ScopedHICON previous_icon = std::move(app_icon_);
821 app_icon_ = IconUtil::CreateHICONFromSkBitmap(*app_icon.bitmap()); 821 app_icon_ = IconUtil::CreateHICONFromSkBitmap(*app_icon.bitmap());
822 SendMessage(hwnd(), WM_SETICON, ICON_BIG, 822 SendMessage(hwnd(), WM_SETICON, ICON_BIG,
823 reinterpret_cast<LPARAM>(app_icon_.get())); 823 reinterpret_cast<LPARAM>(app_icon_.get()));
824 } 824 }
825 } 825 }
826 826
827 void HWNDMessageHandler::SetFullscreen(bool fullscreen) { 827 void HWNDMessageHandler::SetFullscreen(bool fullscreen) {
828 background_fullscreen_hack_ = false; 828 background_fullscreen_hack_ = false;
829 fullscreen_handler()->SetFullscreen(fullscreen); 829 fullscreen_handler()->SetFullscreen(fullscreen);
830 // If we are out of fullscreen and there was a pending DWM transition for the
831 // window, then go ahead and do it now.
832 if (!fullscreen && dwm_transition_desired_)
833 PerformDwmTransition();
834 830
835 // Add the fullscreen window to the fullscreen window map which is used to 831 // Add the fullscreen window to the fullscreen window map which is used to
836 // handle window activations. 832 // handle window activations.
837 HMONITOR monitor = MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY); 833 HMONITOR monitor = MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY);
838 if (fullscreen) { 834 if (fullscreen) {
839 (fullscreen_monitor_map_.Get())[monitor] = this; 835 (fullscreen_monitor_map_.Get())[monitor] = this;
840 } else { 836 } else {
841 FullscreenWindowMonitorMap::iterator iter = 837 FullscreenWindowMonitorMap::iterator iter =
842 fullscreen_monitor_map_.Get().find(monitor); 838 fullscreen_monitor_map_.Get().find(monitor);
843 if (iter != fullscreen_monitor_map_.Get().end()) 839 if (iter != fullscreen_monitor_map_.Get().end())
844 fullscreen_monitor_map_.Get().erase(iter); 840 fullscreen_monitor_map_.Get().erase(iter);
845 } 841 }
842 // If we are out of fullscreen and there was a pending DWM transition for the
843 // window, then go ahead and do it now.
844 if (!fullscreen && dwm_transition_desired_)
845 PerformDwmTransition();
846 } 846 }
847 847
848 void HWNDMessageHandler::SizeConstraintsChanged() { 848 void HWNDMessageHandler::SizeConstraintsChanged() {
849 LONG style = GetWindowLong(hwnd(), GWL_STYLE); 849 LONG style = GetWindowLong(hwnd(), GWL_STYLE);
850 // Ignore if this is not a standard window. 850 // Ignore if this is not a standard window.
851 if (style & (WS_POPUP | WS_CHILD)) 851 if (style & (WS_POPUP | WS_CHILD))
852 return; 852 return;
853 853
854 LONG exstyle = GetWindowLong(hwnd(), GWL_EXSTYLE); 854 LONG exstyle = GetWindowLong(hwnd(), GWL_EXSTYLE);
855 // Windows cannot have WS_THICKFRAME set if WS_EX_COMPOSITED is set. 855 // Windows cannot have WS_THICKFRAME set if WS_EX_COMPOSITED is set.
(...skipping 1924 matching lines...) Expand 10 before | Expand all | Expand 10 after
2780 MONITORINFO monitor_info = {sizeof(monitor_info)}; 2780 MONITORINFO monitor_info = {sizeof(monitor_info)};
2781 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY), 2781 GetMonitorInfo(MonitorFromWindow(hwnd(), MONITOR_DEFAULTTOPRIMARY),
2782 &monitor_info); 2782 &monitor_info);
2783 gfx::Rect shrunk_rect(monitor_info.rcMonitor); 2783 gfx::Rect shrunk_rect(monitor_info.rcMonitor);
2784 shrunk_rect.set_height(shrunk_rect.height() - 1); 2784 shrunk_rect.set_height(shrunk_rect.height() - 1);
2785 background_fullscreen_hack_ = true; 2785 background_fullscreen_hack_ = true;
2786 SetBoundsInternal(shrunk_rect, false); 2786 SetBoundsInternal(shrunk_rect, false);
2787 } 2787 }
2788 2788
2789 } // namespace views 2789 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/widget.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698