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_x11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_root_window_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 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 "_NET_WM_PING", | 82 "_NET_WM_PING", |
83 "_NET_WM_STATE", | 83 "_NET_WM_STATE", |
84 "_NET_WM_STATE_ABOVE", | 84 "_NET_WM_STATE_ABOVE", |
85 "_NET_WM_STATE_FULLSCREEN", | 85 "_NET_WM_STATE_FULLSCREEN", |
86 "_NET_WM_STATE_HIDDEN", | 86 "_NET_WM_STATE_HIDDEN", |
87 "_NET_WM_STATE_MAXIMIZED_HORZ", | 87 "_NET_WM_STATE_MAXIMIZED_HORZ", |
88 "_NET_WM_STATE_MAXIMIZED_VERT", | 88 "_NET_WM_STATE_MAXIMIZED_VERT", |
89 "_NET_WM_STATE_SKIP_TASKBAR", | 89 "_NET_WM_STATE_SKIP_TASKBAR", |
90 "_NET_WM_WINDOW_OPACITY", | 90 "_NET_WM_WINDOW_OPACITY", |
91 "_NET_WM_WINDOW_TYPE", | 91 "_NET_WM_WINDOW_TYPE", |
| 92 "_NET_WM_WINDOW_TYPE_DND", |
92 "_NET_WM_WINDOW_TYPE_MENU", | 93 "_NET_WM_WINDOW_TYPE_MENU", |
93 "_NET_WM_WINDOW_TYPE_NORMAL", | 94 "_NET_WM_WINDOW_TYPE_NORMAL", |
94 "_NET_WM_WINDOW_TYPE_NOTIFICATION", | 95 "_NET_WM_WINDOW_TYPE_NOTIFICATION", |
95 "_NET_WM_WINDOW_TYPE_TOOLTIP", | 96 "_NET_WM_WINDOW_TYPE_TOOLTIP", |
96 "XdndActionAsk", | 97 "XdndActionAsk", |
97 "XdndActionCopy" | 98 "XdndActionCopy" |
98 "XdndActionLink", | 99 "XdndActionLink", |
99 "XdndActionList", | 100 "XdndActionList", |
100 "XdndActionMove", | 101 "XdndActionMove", |
101 "XdndActionPrivate", | 102 "XdndActionPrivate", |
(...skipping 814 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
916 const Widget::InitParams& params) { | 917 const Widget::InitParams& params) { |
917 unsigned long attribute_mask = CWBackPixmap; | 918 unsigned long attribute_mask = CWBackPixmap; |
918 XSetWindowAttributes swa; | 919 XSetWindowAttributes swa; |
919 memset(&swa, 0, sizeof(swa)); | 920 memset(&swa, 0, sizeof(swa)); |
920 swa.background_pixmap = None; | 921 swa.background_pixmap = None; |
921 | 922 |
922 ::Atom window_type; | 923 ::Atom window_type; |
923 switch (params.type) { | 924 switch (params.type) { |
924 case Widget::InitParams::TYPE_MENU: | 925 case Widget::InitParams::TYPE_MENU: |
925 swa.override_redirect = True; | 926 swa.override_redirect = True; |
926 attribute_mask |= CWOverrideRedirect; | |
927 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_MENU"); | 927 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_MENU"); |
928 break; | 928 break; |
929 case Widget::InitParams::TYPE_TOOLTIP: | 929 case Widget::InitParams::TYPE_TOOLTIP: |
930 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_TOOLTIP"); | 930 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_TOOLTIP"); |
931 break; | 931 break; |
932 case Widget::InitParams::TYPE_POPUP: | 932 case Widget::InitParams::TYPE_POPUP: |
933 swa.override_redirect = True; | 933 swa.override_redirect = True; |
934 attribute_mask |= CWOverrideRedirect; | |
935 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_NOTIFICATION"); | 934 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_NOTIFICATION"); |
936 break; | 935 break; |
| 936 case Widget::InitParams::TYPE_DRAG: |
| 937 swa.override_redirect = True; |
| 938 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_DND"); |
| 939 break; |
937 default: | 940 default: |
938 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_NORMAL"); | 941 window_type = atom_cache_.GetAtom("_NET_WM_WINDOW_TYPE_NORMAL"); |
939 break; | 942 break; |
940 } | 943 } |
| 944 if (swa.override_redirect) |
| 945 attribute_mask |= CWOverrideRedirect; |
941 | 946 |
942 bounds_ = params.bounds; | 947 bounds_ = params.bounds; |
943 xwindow_ = XCreateWindow( | 948 xwindow_ = XCreateWindow( |
944 xdisplay_, x_root_window_, | 949 xdisplay_, x_root_window_, |
945 bounds_.x(), bounds_.y(), | 950 bounds_.x(), bounds_.y(), |
946 bounds_.width(), bounds_.height(), | 951 bounds_.width(), bounds_.height(), |
947 0, // border width | 952 0, // border width |
948 CopyFromParent, // depth | 953 CopyFromParent, // depth |
949 InputOutput, | 954 InputOutput, |
950 CopyFromParent, // visual | 955 CopyFromParent, // visual |
(...skipping 560 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1511 if (linux_ui) { | 1516 if (linux_ui) { |
1512 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); | 1517 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(); |
1513 if (native_theme) | 1518 if (native_theme) |
1514 return native_theme; | 1519 return native_theme; |
1515 } | 1520 } |
1516 | 1521 |
1517 return ui::NativeTheme::instance(); | 1522 return ui::NativeTheme::instance(); |
1518 } | 1523 } |
1519 | 1524 |
1520 } // namespace views | 1525 } // namespace views |
OLD | NEW |