Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 28 May 2019 17:26:32 +0000 (UTC)
From:      "Carlos J. Puga Medina" <cpm@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r502903 - in head/www/chromium: . files
Message-ID:  <201905281726.x4SHQWIY073068@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cpm
Date: Tue May 28 17:26:32 2019
New Revision: 502903
URL: https://svnweb.freebsd.org/changeset/ports/502903

Log:
  - Add an upstream fix for issue 956061: Context menu and on top elements draw a black rectangle.
  
  Read for more details: https://bugs.chromium.org/p/chromium/issues/detail?id=956061

Added:
  head/www/chromium/files/patch-ui_gl_gl__surface__glx.cc   (contents, props changed)
  head/www/chromium/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__x11.cc   (contents, props changed)
Modified:
  head/www/chromium/Makefile
  head/www/chromium/files/patch-ui_gl_BUILD.gn

Modified: head/www/chromium/Makefile
==============================================================================
--- head/www/chromium/Makefile	Tue May 28 16:39:37 2019	(r502902)
+++ head/www/chromium/Makefile	Tue May 28 17:26:32 2019	(r502903)
@@ -3,6 +3,7 @@
 
 PORTNAME=	chromium
 PORTVERSION=	74.0.3729.157
+PORTREVISION=	1
 CATEGORIES?=	www
 MASTER_SITES=	https://commondatastorage.googleapis.com/chromium-browser-official/ \
 		LOCAL/cpm/chromium/:fonts

Modified: head/www/chromium/files/patch-ui_gl_BUILD.gn
==============================================================================
--- head/www/chromium/files/patch-ui_gl_BUILD.gn	Tue May 28 16:39:37 2019	(r502902)
+++ head/www/chromium/files/patch-ui_gl_BUILD.gn	Tue May 28 17:26:32 2019	(r502903)
@@ -1,6 +1,6 @@
---- ui/gl/BUILD.gn.orig	2019-04-30 22:23:42 UTC
-+++ ui/gl/BUILD.gn
-@@ -213,7 +213,7 @@ jumbo_component("gl") {
+--- ui/gl/BUILD.gn.orig	2019-05-14 20:51:39.000000000 +0200
++++ ui/gl/BUILD.gn	2019-05-28 10:25:43.492274000 +0200
+@@ -213,7 +213,7 @@
        ]
      }
  
@@ -9,3 +9,15 @@
        # Windows has USE_EGL but doesn't support base::FileDescriptor.
        # libsync isn't supported or needed on MacOSX.
        # Fuchsia is excluded due to a libsync dependency and because it's
+@@ -272,7 +272,10 @@
+       "//build/config/linux:xext",
+     ]
+ 
+-    deps += [ "//ui/gfx/x" ]
++    deps += [
++      "//ui/base/x",
++      "//ui/gfx/x",
++    ]
+   }
+   if (is_win) {
+     sources += [

Added: head/www/chromium/files/patch-ui_gl_gl__surface__glx.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/chromium/files/patch-ui_gl_gl__surface__glx.cc	Tue May 28 17:26:32 2019	(r502903)
@@ -0,0 +1,64 @@
+--- ui/gl/gl_surface_glx.cc.orig	2019-05-28 10:26:51.705074000 +0200
++++ ui/gl/gl_surface_glx.cc	2019-05-28 10:44:19.461809000 +0200
+@@ -21,6 +21,7 @@
+ #include "base/time/time.h"
+ #include "base/trace_event/trace_event.h"
+ #include "build/build_config.h"
++#include "ui/base/x/x11_util.h"
+ #include "ui/events/platform/platform_event_source.h"
+ #include "ui/gfx/x/x11.h"
+ #include "ui/gfx/x/x11_connection.h"
+@@ -431,7 +432,9 @@
+   }
+ 
+   const XVisualInfo& visual_info =
+-      gl::GLVisualPickerGLX::GetInstance()->rgba_visual();
++      ui::IsCompositingManagerPresent()
++          ? gl::GLVisualPickerGLX::GetInstance()->rgba_visual()
++          : gl::GLVisualPickerGLX::GetInstance()->system_visual();
+   g_visual = visual_info.visual;
+   g_depth = visual_info.depth;
+   g_colormap =
+@@ -581,18 +584,30 @@
+   }
+   size_ = gfx::Size(attributes.width, attributes.height);
+ 
+-  XSetWindowAttributes swa;
+-  memset(&swa, 0, sizeof(swa));
+-  swa.background_pixmap = 0;
+-  swa.bit_gravity = NorthWestGravity;
+-  swa.colormap = g_colormap;
+-  swa.background_pixel = 0;
+-  swa.border_pixel = 0;
+-  window_ = XCreateWindow(
+-      gfx::GetXDisplay(), parent_window_, 0 /* x */, 0 /* y */, size_.width(),
+-      size_.height(), 0 /* border_width */, g_depth, InputOutput, g_visual,
+-      CWBackPixmap | CWBitGravity | CWColormap | CWBackPixel | CWBorderPixel,
+-      &swa);
++  XSetWindowAttributes swa = {
++      .background_pixmap = 0,
++      .bit_gravity = NorthWestGravity,
++      .colormap = g_colormap,
++      .background_pixel = 0, // ARGB(0,0,0,0) for compositing WM
++      .border_pixel = 0,
++  };
++  auto value_mask = CWBackPixmap | CWBitGravity | CWColormap | CWBorderPixel;
++  if (ui::IsCompositingManagerPresent() &&
++      XVisualIDFromVisual(attributes.visual) == XVisualIDFromVisual(g_visual)) {
++    // When parent and child are using the same visual, the back buffer will be
++    // shared between parent and child. If WM compositing is enabled, we set
++    // child's background pixel to ARGB(0,0,0,0), so ARGB(0,0,0,0) will be
++    // filled to the shared buffer, when the child window is mapped. It can
++    // avoid an annoying flash when the child window is mapped below.
++    // If WM compositing is disabled, we don't set the background pixel, so
++    // nothing will be draw when the child window is mapped.
++    value_mask |= CWBackPixel;
++  }
++
++  window_ =
++      XCreateWindow(gfx::GetXDisplay(), parent_window_, 0 /* x */, 0 /* y */,
++                    size_.width(), size_.height(), 0 /* border_width */,
++                    g_depth, InputOutput, g_visual, value_mask, &swa);
+   if (!window_) {
+     LOG(ERROR) << "XCreateWindow failed";
+     return false;

Added: head/www/chromium/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__x11.cc
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/www/chromium/files/patch-ui_views_widget_desktop__aura_desktop__window__tree__host__x11.cc	Tue May 28 17:26:32 2019	(r502903)
@@ -0,0 +1,32 @@
+--- ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc.orig	2019-05-28 10:19:21.517467000 +0200
++++ ui/views/widget/desktop_aura/desktop_window_tree_host_x11.cc	2019-05-28 10:22:46.373548000 +0200
+@@ -1440,24 +1440,15 @@
+   if (swa.override_redirect)
+     attribute_mask |= CWOverrideRedirect;
+ 
+-  bool enable_transparent_visuals;
+-  switch (params.opacity) {
+-    case Widget::InitParams::OPAQUE_WINDOW:
+-      enable_transparent_visuals = false;
+-      break;
+-    case Widget::InitParams::TRANSLUCENT_WINDOW:
+-      enable_transparent_visuals = true;
+-      break;
+-    case Widget::InitParams::INFER_OPACITY:
+-    default:
+-      enable_transparent_visuals = params.type == Widget::InitParams::TYPE_DRAG;
+-  }
+-
+   Visual* visual = CopyFromParent;
+   int depth = CopyFromParent;
+   Colormap colormap = CopyFromParent;
++
++  // GLSurfaceGLX always create child window with alpha channel. If the parent
++  // window doesn't have alpha channel, it causes flash, so always request argb
++  // visual.
+   ui::XVisualManager::GetInstance()->ChooseVisualForWindow(
+-      enable_transparent_visuals, &visual, &depth, &colormap,
++      true /* want_argb_visual */, &visual, &depth, &colormap,
+       &use_argb_visual_);
+ 
+   if (colormap != CopyFromParent) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905281726.x4SHQWIY073068>