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 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 | 342 |
343 desktop_native_widget_aura_->OnHostClosed(); | 343 desktop_native_widget_aura_->OnHostClosed(); |
344 } | 344 } |
345 | 345 |
346 aura::WindowTreeHost* DesktopWindowTreeHostX11::AsWindowTreeHost() { | 346 aura::WindowTreeHost* DesktopWindowTreeHostX11::AsWindowTreeHost() { |
347 return this; | 347 return this; |
348 } | 348 } |
349 | 349 |
350 void DesktopWindowTreeHostX11::ShowWindowWithState( | 350 void DesktopWindowTreeHostX11::ShowWindowWithState( |
351 ui::WindowShowState show_state) { | 351 ui::WindowShowState show_state) { |
352 if (!window_mapped_) { | 352 if (!window_mapped_) |
353 MapWindow(show_state); | 353 MapWindow(show_state); |
354 ResetWindowRegion(); | |
355 } | |
356 | 354 |
357 if (show_state == ui::SHOW_STATE_NORMAL || | 355 if (show_state == ui::SHOW_STATE_NORMAL || |
358 show_state == ui::SHOW_STATE_MAXIMIZED) { | 356 show_state == ui::SHOW_STATE_MAXIMIZED) { |
359 // Note: XFCE ignores a maximize hint given before mapping the window. | 357 // Note: XFCE ignores a maximize hint given before mapping the window. |
360 if (show_state == ui::SHOW_STATE_MAXIMIZED) | 358 if (show_state == ui::SHOW_STATE_MAXIMIZED) |
361 Maximize(); | 359 Maximize(); |
362 Activate(); | 360 Activate(); |
363 } | 361 } |
364 | 362 |
365 native_widget_delegate_->AsWidget()->SetInitialFocus(show_state); | 363 native_widget_delegate_->AsWidget()->SetInitialFocus(show_state); |
(...skipping 901 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1267 } | 1265 } |
1268 | 1266 |
1269 bool DesktopWindowTreeHostX11::HasWMSpecProperty(const char* property) const { | 1267 bool DesktopWindowTreeHostX11::HasWMSpecProperty(const char* property) const { |
1270 return window_properties_.find(atom_cache_.GetAtom(property)) != | 1268 return window_properties_.find(atom_cache_.GetAtom(property)) != |
1271 window_properties_.end(); | 1269 window_properties_.end(); |
1272 } | 1270 } |
1273 | 1271 |
1274 void DesktopWindowTreeHostX11::SetUseNativeFrame(bool use_native_frame) { | 1272 void DesktopWindowTreeHostX11::SetUseNativeFrame(bool use_native_frame) { |
1275 use_native_frame_ = use_native_frame; | 1273 use_native_frame_ = use_native_frame; |
1276 x11_window_event_filter_->SetUseHostWindowBorders(use_native_frame); | 1274 x11_window_event_filter_->SetUseHostWindowBorders(use_native_frame); |
1275 ResetWindowRegion(); | |
pkotwicz
2014/06/10 22:00:53
I am unsure if XShapeCombineRectangles() is safe t
| |
1277 } | 1276 } |
1278 | 1277 |
1279 void DesktopWindowTreeHostX11::OnCaptureReleased() { | 1278 void DesktopWindowTreeHostX11::OnCaptureReleased() { |
1280 x11_capture_.reset(); | 1279 x11_capture_.reset(); |
1281 g_current_capture = NULL; | 1280 g_current_capture = NULL; |
1282 OnHostLostWindowCapture(); | 1281 OnHostLostWindowCapture(); |
1283 native_widget_delegate_->OnMouseCaptureLost(); | 1282 native_widget_delegate_->OnMouseCaptureLost(); |
1284 } | 1283 } |
1285 | 1284 |
1286 void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) { | 1285 void DesktopWindowTreeHostX11::DispatchMouseEvent(ui::MouseEvent* event) { |
(...skipping 481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1768 if (linux_ui) { | 1767 if (linux_ui) { |
1769 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1768 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
1770 if (native_theme) | 1769 if (native_theme) |
1771 return native_theme; | 1770 return native_theme; |
1772 } | 1771 } |
1773 | 1772 |
1774 return ui::NativeTheme::instance(); | 1773 return ui::NativeTheme::instance(); |
1775 } | 1774 } |
1776 | 1775 |
1777 } // namespace views | 1776 } // namespace views |
OLD | NEW |