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 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1272 ViewsDelegate::GetInstance() | 1272 ViewsDelegate::GetInstance() |
1273 ? ViewsDelegate::GetInstance()->GetDefaultWindowIcon() | 1273 ? ViewsDelegate::GetInstance()->GetDefaultWindowIcon() |
1274 : NULL; | 1274 : NULL; |
1275 if (window_icon) { | 1275 if (window_icon) { |
1276 SetWindowIcons(gfx::ImageSkia(), *window_icon); | 1276 SetWindowIcons(gfx::ImageSkia(), *window_icon); |
1277 } | 1277 } |
1278 CreateCompositor(); | 1278 CreateCompositor(); |
1279 OnAcceleratedWidgetAvailable(); | 1279 OnAcceleratedWidgetAvailable(); |
1280 } | 1280 } |
1281 | 1281 |
| 1282 void DesktopWindowTreeHostX11::RemapAsNormalWindow() { |
| 1283 XUnmapWindow(xdisplay_, xwindow_); |
| 1284 XSetWindowAttributes swa; |
| 1285 swa.override_redirect = False; |
| 1286 XChangeWindowAttributes(xdisplay_, xwindow_, CWOverrideRedirect, &swa); |
| 1287 XMapWindow(xdisplay_, xwindow_); |
| 1288 } |
| 1289 |
1282 gfx::Size DesktopWindowTreeHostX11::AdjustSize( | 1290 gfx::Size DesktopWindowTreeHostX11::AdjustSize( |
1283 const gfx::Size& requested_size_in_pixels) { | 1291 const gfx::Size& requested_size_in_pixels) { |
1284 std::vector<gfx::Display> displays = | 1292 std::vector<gfx::Display> displays = |
1285 gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)->GetAllDisplays(); | 1293 gfx::Screen::GetScreenByType(gfx::SCREEN_TYPE_NATIVE)->GetAllDisplays(); |
1286 // Compare against all monitor sizes. The window manager can move the window | 1294 // Compare against all monitor sizes. The window manager can move the window |
1287 // to whichever monitor it wants. | 1295 // to whichever monitor it wants. |
1288 for (size_t i = 0; i < displays.size(); ++i) { | 1296 for (size_t i = 0; i < displays.size(); ++i) { |
1289 if (requested_size_in_pixels == displays[i].GetSizeInPixel()) { | 1297 if (requested_size_in_pixels == displays[i].GetSizeInPixel()) { |
1290 return gfx::Size(requested_size_in_pixels.width() - 1, | 1298 return gfx::Size(requested_size_in_pixels.width() - 1, |
1291 requested_size_in_pixels.height() - 1); | 1299 requested_size_in_pixels.height() - 1); |
(...skipping 764 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2056 if (linux_ui) { | 2064 if (linux_ui) { |
2057 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 2065 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
2058 if (native_theme) | 2066 if (native_theme) |
2059 return native_theme; | 2067 return native_theme; |
2060 } | 2068 } |
2061 | 2069 |
2062 return ui::NativeTheme::instance(); | 2070 return ui::NativeTheme::instance(); |
2063 } | 2071 } |
2064 | 2072 |
2065 } // namespace views | 2073 } // namespace views |
OLD | NEW |