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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
786 // | 786 // |
787 // All of this could be made much, much better. | 787 // All of this could be made much, much better. |
788 std::vector<unsigned long> data; | 788 std::vector<unsigned long> data; |
789 | 789 |
790 if (window_icon.HasRepresentation(1.0f)) | 790 if (window_icon.HasRepresentation(1.0f)) |
791 SerializeImageRepresentation(window_icon.GetRepresentation(1.0f), &data); | 791 SerializeImageRepresentation(window_icon.GetRepresentation(1.0f), &data); |
792 | 792 |
793 if (app_icon.HasRepresentation(1.0f)) | 793 if (app_icon.HasRepresentation(1.0f)) |
794 SerializeImageRepresentation(app_icon.GetRepresentation(1.0f), &data); | 794 SerializeImageRepresentation(app_icon.GetRepresentation(1.0f), &data); |
795 | 795 |
796 if (data.empty()) | 796 if (!data.empty()) |
797 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("_NET_WM_ICON")); | |
798 else | |
799 ui::SetAtomArrayProperty(xwindow_, "_NET_WM_ICON", "CARDINAL", data); | 797 ui::SetAtomArrayProperty(xwindow_, "_NET_WM_ICON", "CARDINAL", data); |
800 } | 798 } |
801 | 799 |
802 void DesktopWindowTreeHostX11::InitModalType(ui::ModalType modal_type) { | 800 void DesktopWindowTreeHostX11::InitModalType(ui::ModalType modal_type) { |
803 switch (modal_type) { | 801 switch (modal_type) { |
804 case ui::MODAL_TYPE_NONE: | 802 case ui::MODAL_TYPE_NONE: |
805 break; | 803 break; |
806 default: | 804 default: |
807 // TODO(erg): Figure out under what situations |modal_type| isn't | 805 // TODO(erg): Figure out under what situations |modal_type| isn't |
808 // none. The comment in desktop_native_widget_aura.cc suggests that this | 806 // none. The comment in desktop_native_widget_aura.cc suggests that this |
(...skipping 1176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1985 if (linux_ui) { | 1983 if (linux_ui) { |
1986 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); | 1984 ui::NativeTheme* native_theme = linux_ui->GetNativeTheme(window); |
1987 if (native_theme) | 1985 if (native_theme) |
1988 return native_theme; | 1986 return native_theme; |
1989 } | 1987 } |
1990 | 1988 |
1991 return ui::NativeTheme::instance(); | 1989 return ui::NativeTheme::instance(); |
1992 } | 1990 } |
1993 | 1991 |
1994 } // namespace views | 1992 } // namespace views |
OLD | NEW |