Chromium Code Reviews| 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_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_aura/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 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 322 Widget::InitParams sanitized_params = params; | 322 Widget::InitParams sanitized_params = params; |
| 323 if (sanitized_params.bounds.width() == 0) | 323 if (sanitized_params.bounds.width() == 0) |
| 324 sanitized_params.bounds.set_width(100); | 324 sanitized_params.bounds.set_width(100); |
| 325 if (sanitized_params.bounds.height() == 0) | 325 if (sanitized_params.bounds.height() == 0) |
| 326 sanitized_params.bounds.set_height(100); | 326 sanitized_params.bounds.set_height(100); |
| 327 | 327 |
| 328 InitX11Window(sanitized_params); | 328 InitX11Window(sanitized_params); |
| 329 return InitRootWindow(sanitized_params); | 329 return InitRootWindow(sanitized_params); |
| 330 } | 330 } |
| 331 | 331 |
| 332 void DesktopRootWindowHostLinux::InitFocus(aura::Window* window) { | |
| 333 NOTIMPLEMENTED(); | |
|
sky
2013/03/15 03:15:05
Should this be focus_client_->FocusWindow(window);
scottmg
2013/03/15 22:23:46
I don't know, I haven't tested on Linux beyond mak
| |
| 334 } | |
| 335 | |
| 332 void DesktopRootWindowHostLinux::Close() { | 336 void DesktopRootWindowHostLinux::Close() { |
| 333 // TODO(erg): Might need to do additional hiding tasks here. | 337 // TODO(erg): Might need to do additional hiding tasks here. |
| 334 | 338 |
| 335 if (!close_widget_factory_.HasWeakPtrs()) { | 339 if (!close_widget_factory_.HasWeakPtrs()) { |
| 336 // And we delay the close so that if we are called from an ATL callback, | 340 // And we delay the close so that if we are called from an ATL callback, |
| 337 // we don't destroy the window before the callback returned (as the caller | 341 // we don't destroy the window before the callback returned (as the caller |
| 338 // may delete ourselves on destroy and the ATL callback would still | 342 // may delete ourselves on destroy and the ATL callback would still |
| 339 // dereference us when the callback returns). | 343 // dereference us when the callback returns). |
| 340 MessageLoop::current()->PostTask( | 344 MessageLoop::current()->PostTask( |
| 341 FROM_HERE, | 345 FROM_HERE, |
| (...skipping 528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 870 XSendEvent(xdisplay_, xwindow_, False, 0, &xevent); | 874 XSendEvent(xdisplay_, xwindow_, False, 0, &xevent); |
| 871 } | 875 } |
| 872 | 876 |
| 873 void DesktopRootWindowHostLinux::OnDeviceScaleFactorChanged( | 877 void DesktopRootWindowHostLinux::OnDeviceScaleFactorChanged( |
| 874 float device_scale_factor) { | 878 float device_scale_factor) { |
| 875 } | 879 } |
| 876 | 880 |
| 877 void DesktopRootWindowHostLinux::PrepareForShutdown() { | 881 void DesktopRootWindowHostLinux::PrepareForShutdown() { |
| 878 } | 882 } |
| 879 | 883 |
| 884 void DesktopRootWindowHostLinux::SetHostWindowExpansion( | |
| 885 const gfx::Rect& extra) { | |
| 886 NOTIMPLEMENTED(); | |
| 887 } | |
| 888 | |
| 880 //////////////////////////////////////////////////////////////////////////////// | 889 //////////////////////////////////////////////////////////////////////////////// |
| 881 // DesktopRootWindowHostLinux, MessageLoop::Dispatcher implementation: | 890 // DesktopRootWindowHostLinux, MessageLoop::Dispatcher implementation: |
| 882 | 891 |
| 883 bool DesktopRootWindowHostLinux::Dispatch(const base::NativeEvent& event) { | 892 bool DesktopRootWindowHostLinux::Dispatch(const base::NativeEvent& event) { |
| 884 XEvent* xev = event; | 893 XEvent* xev = event; |
| 885 | 894 |
| 886 // May want to factor CheckXEventForConsistency(xev); into a common location | 895 // May want to factor CheckXEventForConsistency(xev); into a common location |
| 887 // since it is called here. | 896 // since it is called here. |
| 888 switch (xev->type) { | 897 switch (xev->type) { |
| 889 case Expose: | 898 case Expose: |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1109 // their window change is synchronous.) | 1118 // their window change is synchronous.) |
| 1110 // | 1119 // |
| 1111 // TODO(erg): While this does work, there's a quick flash showing the | 1120 // TODO(erg): While this does work, there's a quick flash showing the |
| 1112 // tabstrip/toolbar/etc. when going into fullscreen mode before hiding | 1121 // tabstrip/toolbar/etc. when going into fullscreen mode before hiding |
| 1113 // those parts of the UI because we receive the sizing event from the | 1122 // those parts of the UI because we receive the sizing event from the |
| 1114 // window manager before we receive the event that changes the | 1123 // window manager before we receive the event that changes the |
| 1115 // fullscreen state. Unsure what to do about that. | 1124 // fullscreen state. Unsure what to do about that. |
| 1116 Widget* widget = native_widget_delegate_->AsWidget(); | 1125 Widget* widget = native_widget_delegate_->AsWidget(); |
| 1117 widget->client_view()->InvalidateLayout(); | 1126 widget->client_view()->InvalidateLayout(); |
| 1118 widget->non_client_view()->InvalidateLayout(); | 1127 widget->non_client_view()->InvalidateLayout(); |
| 1119 widget->GetRootView()->Layout(); | 1128 widget->GetRootView()->Layout(); |
|
scottmg
2013/03/14 22:51:53
(due to rebase, not this CL)
| |
| 1120 } | 1129 } |
| 1121 } | 1130 } |
| 1122 } | 1131 } |
| 1123 return true; | 1132 return true; |
| 1124 } | 1133 } |
| 1125 | 1134 |
| 1126 //////////////////////////////////////////////////////////////////////////////// | 1135 //////////////////////////////////////////////////////////////////////////////// |
| 1127 // DesktopRootWindowHost, public: | 1136 // DesktopRootWindowHost, public: |
| 1128 | 1137 |
| 1129 // static | 1138 // static |
| 1130 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1139 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 1131 internal::NativeWidgetDelegate* native_widget_delegate, | 1140 internal::NativeWidgetDelegate* native_widget_delegate, |
| 1132 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1141 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 1133 const gfx::Rect& initial_bounds) { | 1142 const gfx::Rect& initial_bounds) { |
| 1134 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1143 return new DesktopRootWindowHostLinux(native_widget_delegate, |
| 1135 desktop_native_widget_aura, | 1144 desktop_native_widget_aura, |
| 1136 initial_bounds); | 1145 initial_bounds); |
| 1137 } | 1146 } |
| 1138 | 1147 |
| 1139 } // namespace views | 1148 } // namespace views |
| OLD | NEW |