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

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

Issue 1998653002: Make DesktopWindowTreeHostX11::ShouldWindowContentsBeTransparent() relies on argb visual flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually no need to relax since Xvfb supports 32 depth, it just does not set _NET_WM_CM_S0 bit. Created 4 years, 7 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
« no previous file with comments | « no previous file | ui/views/test/widget_test.h » ('j') | 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) 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 // 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 1402 matching lines...) Expand 10 before | Expand all | Expand 10 after
1413 << " (" << request_str << ")"; 1413 << " (" << request_str << ")";
1414 } 1414 }
1415 1415
1416 #if !defined(OS_CHROMEOS) 1416 #if !defined(OS_CHROMEOS)
1417 void ChooseVisualForWindow(Visual** visual, int* depth) { 1417 void ChooseVisualForWindow(Visual** visual, int* depth) {
1418 static Visual* s_visual = NULL; 1418 static Visual* s_visual = NULL;
1419 static int s_depth = 0; 1419 static int s_depth = 0;
1420 1420
1421 if (!s_visual) { 1421 if (!s_visual) {
1422 XDisplay* display = gfx::GetXDisplay(); 1422 XDisplay* display = gfx::GetXDisplay();
1423 XAtom NET_WM_CM_S0 = XInternAtom(display, "_NET_WM_CM_S0", False); 1423
1424 // Xvfb support 32 bit depths. But for some reasons NET_WM_CM_S0 it not set
1425 // so at check for Composite extension instead.
1426 int opcode = 0;
1427 int eventb = 0;
1428 int errorb = 0;
1429 bool has_composite_ext =
1430 XQueryExtension(display, "Composite", &opcode, &eventb, &errorb);
1431 // XAtom NET_WM_CM_S0 = XInternAtom(display, "_NET_WM_CM_S0", False);
piman 2016/05/20 20:40:38 This is not right. The Composite extension may exi
1424 1432
1425 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1433 if (base::CommandLine::ForCurrentProcess()->HasSwitch(
1426 switches::kEnableTransparentVisuals) && 1434 switches::kEnableTransparentVisuals) &&
1427 XGetSelectionOwner(display, NET_WM_CM_S0) != None) { 1435 has_composite_ext) {
1428 // Choose the first ARGB8888 visual 1436 // Choose the first ARGB8888 visual
1429 XVisualInfo visual_template; 1437 XVisualInfo visual_template;
1430 visual_template.screen = 0; 1438 visual_template.screen = 0;
1431 1439
1432 int visuals_len; 1440 int visuals_len;
1433 gfx::XScopedPtr<XVisualInfo[]> visual_list(XGetVisualInfo( 1441 gfx::XScopedPtr<XVisualInfo[]> visual_list(XGetVisualInfo(
1434 display, VisualScreenMask, &visual_template, &visuals_len)); 1442 display, VisualScreenMask, &visual_template, &visuals_len));
1435 for (int i = 0; i < visuals_len; ++i) { 1443 for (int i = 0; i < visuals_len; ++i) {
1436 // Why support only 8888 ARGB? Because it's all that GTK+ supports. In 1444 // Why support only 8888 ARGB? Because it's all that GTK+ supports. In
1437 // gdkvisual-x11.cc, they look for this specific visual and use it for 1445 // gdkvisual-x11.cc, they look for this specific visual and use it for
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
1469 if (depth) 1477 if (depth)
1470 *depth = s_depth; 1478 *depth = s_depth;
1471 } 1479 }
1472 #endif 1480 #endif
1473 1481
1474 // ---------------------------------------------------------------------------- 1482 // ----------------------------------------------------------------------------
1475 // End of x11_util_internal.h 1483 // End of x11_util_internal.h
1476 1484
1477 1485
1478 } // namespace ui 1486 } // namespace ui
OLDNEW
« no previous file with comments | « no previous file | ui/views/test/widget_test.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698