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 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 enable_transparent_visuals = params.type == Widget::InitParams::TYPE_DRAG; | 1369 enable_transparent_visuals = params.type == Widget::InitParams::TYPE_DRAG; |
1370 } | 1370 } |
1371 | 1371 |
1372 Visual* visual = CopyFromParent; | 1372 Visual* visual = CopyFromParent; |
1373 int depth = CopyFromParent; | 1373 int depth = CopyFromParent; |
1374 Colormap colormap = CopyFromParent; | 1374 Colormap colormap = CopyFromParent; |
1375 ui::XVisualManager::GetInstance()->ChooseVisualForWindow( | 1375 ui::XVisualManager::GetInstance()->ChooseVisualForWindow( |
1376 enable_transparent_visuals, &visual, &depth, &colormap, | 1376 enable_transparent_visuals, &visual, &depth, &colormap, |
1377 &use_argb_visual_); | 1377 &use_argb_visual_); |
1378 | 1378 |
1379 if (colormap != CopyFromParent) { | 1379 attribute_mask |= CWColormap; |
1380 attribute_mask |= CWColormap; | 1380 swa.colormap = colormap; |
1381 swa.colormap = colormap; | |
1382 } | |
1383 | 1381 |
1384 // x.org will BadMatch if we don't set a border when the depth isn't the | 1382 // x.org will BadMatch if we don't set a border when the depth isn't the |
1385 // same as the parent depth. | 1383 // same as the parent depth. |
1386 attribute_mask |= CWBorderPixel; | 1384 attribute_mask |= CWBorderPixel; |
1387 swa.border_pixel = 0; | 1385 swa.border_pixel = 0; |
1388 | 1386 |
1389 bounds_in_pixels_ = ToPixelRect(params.bounds); | 1387 bounds_in_pixels_ = ToPixelRect(params.bounds); |
1390 bounds_in_pixels_.set_size(AdjustSize(bounds_in_pixels_.size())); | 1388 bounds_in_pixels_.set_size(AdjustSize(bounds_in_pixels_.size())); |
1391 xwindow_ = XCreateWindow(xdisplay_, x_root_window_, bounds_in_pixels_.x(), | 1389 xwindow_ = XCreateWindow(xdisplay_, x_root_window_, bounds_in_pixels_.x(), |
1392 bounds_in_pixels_.y(), bounds_in_pixels_.width(), | 1390 bounds_in_pixels_.y(), bounds_in_pixels_.width(), |
(...skipping 949 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2342 if (linux_ui) { | 2340 if (linux_ui) { |
2343 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2341 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
2344 if (native_theme) | 2342 if (native_theme) |
2345 return native_theme; | 2343 return native_theme; |
2346 } | 2344 } |
2347 | 2345 |
2348 return ui::NativeThemeAura::instance(); | 2346 return ui::NativeThemeAura::instance(); |
2349 } | 2347 } |
2350 | 2348 |
2351 } // namespace views | 2349 } // namespace views |
OLD | NEW |