| 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 1733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1744 &unused); | 1744 &unused); |
| 1745 } | 1745 } |
| 1746 gfx::Rect bounds_in_pixels(translated_x_in_pixels, translated_y_in_pixels, | 1746 gfx::Rect bounds_in_pixels(translated_x_in_pixels, translated_y_in_pixels, |
| 1747 xev->xconfigure.width, xev->xconfigure.height); | 1747 xev->xconfigure.width, xev->xconfigure.height); |
| 1748 bool size_changed = bounds_in_pixels_.size() != bounds_in_pixels.size(); | 1748 bool size_changed = bounds_in_pixels_.size() != bounds_in_pixels.size(); |
| 1749 bool origin_changed = | 1749 bool origin_changed = |
| 1750 bounds_in_pixels_.origin() != bounds_in_pixels.origin(); | 1750 bounds_in_pixels_.origin() != bounds_in_pixels.origin(); |
| 1751 previous_bounds_in_pixels_ = bounds_in_pixels_; | 1751 previous_bounds_in_pixels_ = bounds_in_pixels_; |
| 1752 bounds_in_pixels_ = bounds_in_pixels; | 1752 bounds_in_pixels_ = bounds_in_pixels; |
| 1753 | 1753 |
| 1754 if (origin_changed) | 1754 if (origin_changed) { |
| 1755 OnHostMoved(bounds_in_pixels_.origin()); | 1755 OnHostMoved(bounds_in_pixels_.origin()); |
| 1756 // Allows visibilityChange events to be triggered while switching |
| 1757 // between workspaces. |
| 1758 ::Screen* screen = DefaultScreenOfDisplay(xdisplay_); |
| 1759 int screen_width = WidthOfScreen(screen); |
| 1760 int screen_height = HeightOfScreen(screen); |
| 1761 |
| 1762 if (translated_x_in_pixels < 0 || translated_x_in_pixels > screen_width |
| 1763 || translated_y_in_pixels < 0 || |
| 1764 translated_y_in_pixels > screen_height) |
| 1765 OnHostSetWindowVisibility(false); |
| 1766 else |
| 1767 OnHostSetWindowVisibility(true); |
| 1768 } |
| 1756 | 1769 |
| 1757 if (size_changed) { | 1770 if (size_changed) { |
| 1758 delayed_resize_task_.Reset(base::Bind( | 1771 delayed_resize_task_.Reset(base::Bind( |
| 1759 &DesktopWindowTreeHostX11::DelayedResize, | 1772 &DesktopWindowTreeHostX11::DelayedResize, |
| 1760 close_widget_factory_.GetWeakPtr(), bounds_in_pixels.size())); | 1773 close_widget_factory_.GetWeakPtr(), bounds_in_pixels.size())); |
| 1761 base::MessageLoop::current()->PostTask( | 1774 base::MessageLoop::current()->PostTask( |
| 1762 FROM_HERE, delayed_resize_task_.callback()); | 1775 FROM_HERE, delayed_resize_task_.callback()); |
| 1763 } | 1776 } |
| 1764 break; | 1777 break; |
| 1765 } | 1778 } |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1985 if (linux_ui) { | 1998 if (linux_ui) { |
| 1986 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1999 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
| 1987 if (native_theme) | 2000 if (native_theme) |
| 1988 return native_theme; | 2001 return native_theme; |
| 1989 } | 2002 } |
| 1990 | 2003 |
| 1991 return ui::NativeTheme::instance(); | 2004 return ui::NativeTheme::instance(); |
| 1992 } | 2005 } |
| 1993 | 2006 |
| 1994 } // namespace views | 2007 } // namespace views |
| OLD | NEW |