OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 // This file defines utility functions for X11 (Linux only). This code has been | 5 // This file defines utility functions for X11 (Linux only). This code has been |
6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support | 6 // ported from XCB since we can't use XCB on Ubuntu while its 32-bit support |
7 // remains woefully incomplete. | 7 // remains woefully incomplete. |
8 | 8 |
9 #include "ui/base/x/x11_util.h" | 9 #include "ui/base/x/x11_util.h" |
10 | 10 |
(...skipping 791 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
802 return monitor_rect.x == window_rect.x() && | 802 return monitor_rect.x == window_rect.x() && |
803 monitor_rect.y == window_rect.y() && | 803 monitor_rect.y == window_rect.y() && |
804 monitor_rect.width == window_rect.width() && | 804 monitor_rect.width == window_rect.width() && |
805 monitor_rect.height == window_rect.height(); | 805 monitor_rect.height == window_rect.height(); |
806 #else | 806 #else |
807 NOTIMPLEMENTED(); | 807 NOTIMPLEMENTED(); |
808 return false; | 808 return false; |
809 #endif | 809 #endif |
810 } | 810 } |
811 | 811 |
812 Atom GetAtomForScreenProperty(const char* atom_name) { | |
813 GdkAtom gdk_atom = gdk_atom_intern_static_string(atom_name); | |
814 return gdk_x11_atom_to_xatom_for_display( | |
sadrul
2011/11/18 17:56:42
Please use non-gtk functions (e.g. XInternAtom)
prasadt
2011/11/18 22:31:42
Done.
As it turns, there is an existing helper fu
| |
815 gdk_screen_get_display(gdk_screen_get_default()), gdk_atom); | |
816 } | |
817 | |
812 // ---------------------------------------------------------------------------- | 818 // ---------------------------------------------------------------------------- |
813 // These functions are declared in x11_util_internal.h because they require | 819 // These functions are declared in x11_util_internal.h because they require |
814 // XLib.h to be included, and it conflicts with many other headers. | 820 // XLib.h to be included, and it conflicts with many other headers. |
815 XRenderPictFormat* GetRenderARGB32Format(Display* dpy) { | 821 XRenderPictFormat* GetRenderARGB32Format(Display* dpy) { |
816 static XRenderPictFormat* pictformat = NULL; | 822 static XRenderPictFormat* pictformat = NULL; |
817 if (pictformat) | 823 if (pictformat) |
818 return pictformat; | 824 return pictformat; |
819 | 825 |
820 // First look for a 32-bit format which ignores the alpha value | 826 // First look for a 32-bit format which ignores the alpha value |
821 XRenderPictFormat templ; | 827 XRenderPictFormat templ; |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
932 << "request_code " << static_cast<int>(error_event.request_code) << ", " | 938 << "request_code " << static_cast<int>(error_event.request_code) << ", " |
933 << "minor_code " << static_cast<int>(error_event.minor_code) | 939 << "minor_code " << static_cast<int>(error_event.minor_code) |
934 << " (" << request_str << ")"; | 940 << " (" << request_str << ")"; |
935 } | 941 } |
936 | 942 |
937 // ---------------------------------------------------------------------------- | 943 // ---------------------------------------------------------------------------- |
938 // End of x11_util_internal.h | 944 // End of x11_util_internal.h |
939 | 945 |
940 | 946 |
941 } // namespace ui | 947 } // namespace ui |
OLD | NEW |