| Index: ui/base/x/x11_util.cc
|
| diff --git a/ui/base/x/x11_util.cc b/ui/base/x/x11_util.cc
|
| index 0d0b95aa9bb66e22e4b4982a5cf9405b13c3622c..75a17e4ac7db822eb8303b5027b60d1103f02bcf 100644
|
| --- a/ui/base/x/x11_util.cc
|
| +++ b/ui/base/x/x11_util.cc
|
| @@ -96,18 +96,12 @@ bool GetProperty(XID window, const std::string& property_name, long max_length,
|
| unsigned char** property) {
|
| XAtom property_atom = gfx::GetAtom(property_name.c_str());
|
| unsigned long remaining_bytes = 0;
|
| - return XGetWindowProperty(gfx::GetXDisplay(),
|
| - window,
|
| - property_atom,
|
| - 0, // offset into property data to read
|
| - max_length, // max length to get
|
| - False, // deleted
|
| - AnyPropertyType,
|
| - type,
|
| - format,
|
| - num_items,
|
| - &remaining_bytes,
|
| - property);
|
| + return XGetWindowProperty(gfx::GetXDisplay(), window, property_atom,
|
| + 0, // offset into property data to read
|
| + max_length, // max length to get
|
| + X11Constants::False, // deleted
|
| + AnyPropertyType, type, format, num_items,
|
| + &remaining_bytes, property);
|
| }
|
|
|
| bool SupportsEWMH() {
|
| @@ -634,7 +628,7 @@ bool WindowContainsPoint(XID window, gfx::Point screen_loc) {
|
|
|
|
|
| bool PropertyExists(XID window, const std::string& property_name) {
|
| - XAtom type = None;
|
| + XAtom type = X11Constants::None;
|
| int format = 0; // size in bits of each item in 'property'
|
| unsigned long num_items = 0;
|
| unsigned char* property = NULL;
|
| @@ -642,7 +636,7 @@ bool PropertyExists(XID window, const std::string& property_name) {
|
| int result = GetProperty(window, property_name, 1,
|
| &type, &format, &num_items, &property);
|
| gfx::XScopedPtr<unsigned char> scoped_property(property);
|
| - if (result != Success)
|
| + if (result != X11Constants::Success)
|
| return false;
|
|
|
| return num_items > 0;
|
| @@ -656,18 +650,18 @@ bool GetRawBytesOfProperty(XID window,
|
| // Retrieve the data from our window.
|
| unsigned long nitems = 0;
|
| unsigned long nbytes = 0;
|
| - XAtom prop_type = None;
|
| + XAtom prop_type = X11Constants::None;
|
| int prop_format = 0;
|
| unsigned char* property_data = NULL;
|
| - if (XGetWindowProperty(gfx::GetXDisplay(), window, property,
|
| - 0, 0x1FFFFFFF /* MAXINT32 / 4 */, False,
|
| - AnyPropertyType, &prop_type, &prop_format,
|
| - &nitems, &nbytes, &property_data) != Success) {
|
| + if (XGetWindowProperty(gfx::GetXDisplay(), window, property, 0,
|
| + 0x1FFFFFFF /* MAXINT32 / 4 */, X11Constants::False,
|
| + AnyPropertyType, &prop_type, &prop_format, &nitems,
|
| + &nbytes, &property_data) != X11Constants::Success) {
|
| return false;
|
| }
|
| gfx::XScopedPtr<unsigned char> scoped_property(property_data);
|
|
|
| - if (prop_type == None)
|
| + if (prop_type == X11Constants::None)
|
| return false;
|
|
|
| size_t bytes = 0;
|
| @@ -702,7 +696,7 @@ bool GetRawBytesOfProperty(XID window,
|
| }
|
|
|
| bool GetIntProperty(XID window, const std::string& property_name, int* value) {
|
| - XAtom type = None;
|
| + XAtom type = X11Constants::None;
|
| int format = 0; // size in bits of each item in 'property'
|
| unsigned long num_items = 0;
|
| unsigned char* property = NULL;
|
| @@ -710,7 +704,7 @@ bool GetIntProperty(XID window, const std::string& property_name, int* value) {
|
| int result = GetProperty(window, property_name, 1,
|
| &type, &format, &num_items, &property);
|
| gfx::XScopedPtr<unsigned char> scoped_property(property);
|
| - if (result != Success)
|
| + if (result != X11Constants::Success)
|
| return false;
|
|
|
| if (format != 32 || num_items != 1)
|
| @@ -721,7 +715,7 @@ bool GetIntProperty(XID window, const std::string& property_name, int* value) {
|
| }
|
|
|
| bool GetXIDProperty(XID window, const std::string& property_name, XID* value) {
|
| - XAtom type = None;
|
| + XAtom type = X11Constants::None;
|
| int format = 0; // size in bits of each item in 'property'
|
| unsigned long num_items = 0;
|
| unsigned char* property = NULL;
|
| @@ -729,7 +723,7 @@ bool GetXIDProperty(XID window, const std::string& property_name, XID* value) {
|
| int result = GetProperty(window, property_name, 1,
|
| &type, &format, &num_items, &property);
|
| gfx::XScopedPtr<unsigned char> scoped_property(property);
|
| - if (result != Success)
|
| + if (result != X11Constants::Success)
|
| return false;
|
|
|
| if (format != 32 || num_items != 1)
|
| @@ -742,7 +736,7 @@ bool GetXIDProperty(XID window, const std::string& property_name, XID* value) {
|
| bool GetIntArrayProperty(XID window,
|
| const std::string& property_name,
|
| std::vector<int>* value) {
|
| - XAtom type = None;
|
| + XAtom type = X11Constants::None;
|
| int format = 0; // size in bits of each item in 'property'
|
| unsigned long num_items = 0;
|
| unsigned char* properties = NULL;
|
| @@ -751,7 +745,7 @@ bool GetIntArrayProperty(XID window,
|
| (~0L), // (all of them)
|
| &type, &format, &num_items, &properties);
|
| gfx::XScopedPtr<unsigned char> scoped_properties(properties);
|
| - if (result != Success)
|
| + if (result != X11Constants::Success)
|
| return false;
|
|
|
| if (format != 32)
|
| @@ -768,7 +762,7 @@ bool GetIntArrayProperty(XID window,
|
| bool GetAtomArrayProperty(XID window,
|
| const std::string& property_name,
|
| std::vector<XAtom>* value) {
|
| - XAtom type = None;
|
| + XAtom type = X11Constants::None;
|
| int format = 0; // size in bits of each item in 'property'
|
| unsigned long num_items = 0;
|
| unsigned char* properties = NULL;
|
| @@ -777,7 +771,7 @@ bool GetAtomArrayProperty(XID window,
|
| (~0L), // (all of them)
|
| &type, &format, &num_items, &properties);
|
| gfx::XScopedPtr<unsigned char> scoped_properties(properties);
|
| - if (result != Success)
|
| + if (result != X11Constants::Success)
|
| return false;
|
|
|
| if (type != XA_ATOM)
|
| @@ -791,7 +785,7 @@ bool GetAtomArrayProperty(XID window,
|
|
|
| bool GetStringProperty(
|
| XID window, const std::string& property_name, std::string* value) {
|
| - XAtom type = None;
|
| + XAtom type = X11Constants::None;
|
| int format = 0; // size in bits of each item in 'property'
|
| unsigned long num_items = 0;
|
| unsigned char* property = NULL;
|
| @@ -799,7 +793,7 @@ bool GetStringProperty(
|
| int result = GetProperty(window, property_name, 1024,
|
| &type, &format, &num_items, &property);
|
| gfx::XScopedPtr<unsigned char> scoped_property(property);
|
| - if (result != Success)
|
| + if (result != X11Constants::Success)
|
| return false;
|
|
|
| if (format != 8)
|
| @@ -1049,13 +1043,8 @@ bool GetXWindowStack(Window window, std::vector<XID>* windows) {
|
| int format;
|
| unsigned long count;
|
| unsigned char *data = NULL;
|
| - if (GetProperty(window,
|
| - "_NET_CLIENT_LIST_STACKING",
|
| - ~0L,
|
| - &type,
|
| - &format,
|
| - &count,
|
| - &data) != Success) {
|
| + if (GetProperty(window, "_NET_CLIENT_LIST_STACKING", ~0L, &type, &format,
|
| + &count, &data) != X11Constants::Success) {
|
| return false;
|
| }
|
| gfx::XScopedPtr<unsigned char> scoped_data(data);
|
| @@ -1177,8 +1166,8 @@ std::string GuessWindowManagerName() {
|
|
|
| bool IsCompositingManagerPresent() {
|
| static bool is_compositing_manager_present =
|
| - XGetSelectionOwner(gfx::GetXDisplay(), gfx::GetAtom("_NET_WM_CM_S0")) !=
|
| - None;
|
| + XGetSelectionOwner(gfx::GetXDisplay(),
|
| + gfx::GetAtom("_NET_WM_CM_S0")) != X11Constants::None;
|
| return is_compositing_manager_present;
|
| }
|
|
|
| @@ -1381,7 +1370,7 @@ XVisualManager::XVisualManager()
|
| visuals_[visual_list[i].visualid].reset(new XVisualData(visual_list[i]));
|
|
|
| XAtom NET_WM_CM_S0 = gfx::GetAtom("_NET_WM_CM_S0");
|
| - using_compositing_wm_ = XGetSelectionOwner(display_, NET_WM_CM_S0) != None;
|
| + using_compositing_wm_ = XGetSelectionOwner(display_, NET_WM_CM_S0) != X11Constants::None;
|
|
|
| // Choose the opaque visual.
|
| default_visual_id_ =
|
|
|