OLD | NEW |
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/widget/desktop_aura/desktop_window_tree_host_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_window_tree_host_x11.h" |
6 | 6 |
7 #include <X11/extensions/shape.h> | 7 #include <X11/extensions/shape.h> |
8 #include <X11/extensions/XInput2.h> | 8 #include <X11/extensions/XInput2.h> |
9 #include <X11/Xatom.h> | 9 #include <X11/Xatom.h> |
10 #include <X11/Xregion.h> | 10 #include <X11/Xregion.h> |
(...skipping 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
991 | 991 |
992 void DesktopWindowTreeHostX11::SetBounds( | 992 void DesktopWindowTreeHostX11::SetBounds( |
993 const gfx::Rect& requested_bounds_in_pixel) { | 993 const gfx::Rect& requested_bounds_in_pixel) { |
994 gfx::Rect bounds_in_pixels(requested_bounds_in_pixel.origin(), | 994 gfx::Rect bounds_in_pixels(requested_bounds_in_pixel.origin(), |
995 AdjustSize(requested_bounds_in_pixel.size())); | 995 AdjustSize(requested_bounds_in_pixel.size())); |
996 bool origin_changed = bounds_in_pixels_.origin() != bounds_in_pixels.origin(); | 996 bool origin_changed = bounds_in_pixels_.origin() != bounds_in_pixels.origin(); |
997 bool size_changed = bounds_in_pixels_.size() != bounds_in_pixels.size(); | 997 bool size_changed = bounds_in_pixels_.size() != bounds_in_pixels.size(); |
998 XWindowChanges changes = {0}; | 998 XWindowChanges changes = {0}; |
999 unsigned value_mask = 0; | 999 unsigned value_mask = 0; |
1000 | 1000 |
| 1001 delayed_resize_task_.Cancel(); |
| 1002 |
1001 if (size_changed) { | 1003 if (size_changed) { |
1002 // Update the minimum and maximum sizes in case they have changed. | 1004 // Update the minimum and maximum sizes in case they have changed. |
1003 UpdateMinAndMaxSize(); | 1005 UpdateMinAndMaxSize(); |
1004 | 1006 |
1005 if (bounds_in_pixels.width() < min_size_in_pixels_.width() || | 1007 if (bounds_in_pixels.width() < min_size_in_pixels_.width() || |
1006 bounds_in_pixels.height() < min_size_in_pixels_.height() || | 1008 bounds_in_pixels.height() < min_size_in_pixels_.height() || |
1007 (!max_size_in_pixels_.IsEmpty() && | 1009 (!max_size_in_pixels_.IsEmpty() && |
1008 (bounds_in_pixels.width() > max_size_in_pixels_.width() || | 1010 (bounds_in_pixels.width() > max_size_in_pixels_.width() || |
1009 bounds_in_pixels.height() > max_size_in_pixels_.height()))) { | 1011 bounds_in_pixels.height() > max_size_in_pixels_.height()))) { |
1010 gfx::Size size_in_pixels = bounds_in_pixels.size(); | 1012 gfx::Size size_in_pixels = bounds_in_pixels.size(); |
(...skipping 1059 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2070 if (linux_ui) { | 2072 if (linux_ui) { |
2071 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2073 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
2072 if (native_theme) | 2074 if (native_theme) |
2073 return native_theme; | 2075 return native_theme; |
2074 } | 2076 } |
2075 | 2077 |
2076 return ui::NativeThemeAura::instance(); | 2078 return ui::NativeThemeAura::instance(); |
2077 } | 2079 } |
2078 | 2080 |
2079 } // namespace views | 2081 } // namespace views |
OLD | NEW |