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_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_root_window_host_linux.h" |
6 | 6 |
7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
10 | 10 |
(...skipping 878 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
889 } | 889 } |
890 break; | 890 break; |
891 } | 891 } |
892 } // fallthrough | 892 } // fallthrough |
893 case ButtonRelease: { | 893 case ButtonRelease: { |
894 ui::MouseEvent mouseev(xev); | 894 ui::MouseEvent mouseev(xev); |
895 DispatchMouseEvent(&mouseev); | 895 DispatchMouseEvent(&mouseev); |
896 break; | 896 break; |
897 } | 897 } |
898 case FocusOut: | 898 case FocusOut: |
899 if (xev->xfocus.mode != NotifyGrab) | 899 if (xev->xfocus.mode != NotifyGrab) { |
900 root_window_host_delegate_->OnHostLostCapture(); | 900 ReleaseCapture(); |
| 901 root_window_host_delegate_->OnHostLostWindowCapture(); |
| 902 } else { |
| 903 root_window_host_delegate_->OnHostLostMouseGrab(); |
| 904 } |
901 break; | 905 break; |
902 case ConfigureNotify: { | 906 case ConfigureNotify: { |
903 DCHECK_EQ(xwindow_, xev->xconfigure.window); | 907 DCHECK_EQ(xwindow_, xev->xconfigure.window); |
904 DCHECK_EQ(xwindow_, xev->xconfigure.event); | 908 DCHECK_EQ(xwindow_, xev->xconfigure.event); |
905 // It's possible that the X window may be resized by some other means than | 909 // It's possible that the X window may be resized by some other means than |
906 // from within aura (e.g. the X window manager can change the size). Make | 910 // from within aura (e.g. the X window manager can change the size). Make |
907 // sure the root window size is maintained properly. | 911 // sure the root window size is maintained properly. |
908 gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, | 912 gfx::Rect bounds(xev->xconfigure.x, xev->xconfigure.y, |
909 xev->xconfigure.width, xev->xconfigure.height); | 913 xev->xconfigure.width, xev->xconfigure.height); |
910 bool size_changed = bounds_.size() != bounds.size(); | 914 bool size_changed = bounds_.size() != bounds.size(); |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1090 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
1087 internal::NativeWidgetDelegate* native_widget_delegate, | 1091 internal::NativeWidgetDelegate* native_widget_delegate, |
1088 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1092 DesktopNativeWidgetAura* desktop_native_widget_aura, |
1089 const gfx::Rect& initial_bounds) { | 1093 const gfx::Rect& initial_bounds) { |
1090 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1094 return new DesktopRootWindowHostLinux(native_widget_delegate, |
1091 desktop_native_widget_aura, | 1095 desktop_native_widget_aura, |
1092 initial_bounds); | 1096 initial_bounds); |
1093 } | 1097 } |
1094 | 1098 |
1095 } // namespace views | 1099 } // namespace views |
OLD | NEW |