Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(385)

Side by Side Diff: ui/base/x/x11_util.cc

Issue 6350017: A blind fix for Bug 70870... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 return EnumerateChildren(delegate, root, max_depth, 0); 434 return EnumerateChildren(delegate, root, max_depth, 0);
435 } 435 }
436 436
437 bool GetXWindowStack(Window window, std::vector<XID>* windows) { 437 bool GetXWindowStack(Window window, std::vector<XID>* windows) {
438 windows->clear(); 438 windows->clear();
439 439
440 Atom type; 440 Atom type;
441 int format; 441 int format;
442 unsigned long count; 442 unsigned long count;
443 unsigned char *data = NULL; 443 unsigned char *data = NULL;
444 if (!GetProperty(window, 444 if (GetProperty(window,
445 "_NET_CLIENT_LIST_STACKING", 445 "_NET_CLIENT_LIST_STACKING",
446 ~0L, 446 ~0L,
447 &type, 447 &type,
448 &format, 448 &format,
449 &count, 449 &count,
450 &data)) { 450 &data) != Success) {
451 return false; 451 return false;
452 } 452 }
453 453
454 bool result = false; 454 bool result = false;
455 if (type == XA_WINDOW && format == 32 && data && count > 0) { 455 if (type == XA_WINDOW && format == 32 && data && count > 0) {
456 result = true; 456 result = true;
457 XID* stack = reinterpret_cast<XID*>(data); 457 XID* stack = reinterpret_cast<XID*>(data);
458 for (long i = static_cast<long>(count) - 1; i >= 0; i--) 458 for (long i = static_cast<long>(count) - 1; i >= 0; i--)
459 windows->push_back(stack[i]); 459 windows->push_back(stack[i]);
460 } 460 }
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after
915 "X Error detected: serial %lu, error_code %u (%s), " 915 "X Error detected: serial %lu, error_code %u (%s), "
916 "request_code %u minor_code %u (%s)", 916 "request_code %u minor_code %u (%s)",
917 error_event->serial, error_event->error_code, error_str, 917 error_event->serial, error_event->error_code, error_str,
918 error_event->request_code, error_event->minor_code, request_str); 918 error_event->request_code, error_event->minor_code, request_str);
919 } 919 }
920 // ---------------------------------------------------------------------------- 920 // ----------------------------------------------------------------------------
921 // End of x11_util_internal.h 921 // End of x11_util_internal.h
922 922
923 923
924 } // namespace ui 924 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698