Created
October 25, 2019 20:47
-
-
Save ivan/1c0a1ebd8111ad2177258d860033ac65 to your computer and use it in GitHub Desktop.
chromium patches for nixpkgs.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
From 7ad58094797d9dd8a36598bcbbfaafa25a671912 Mon Sep 17 00:00:00 2001 | |
From: Ivan Kozik <ivan@ludios.org> | |
Date: Tue, 1 Jan 2019 16:55:44 +0000 | |
Subject: [PATCH] chromium: add patches | |
--- | |
.../networking/browsers/chromium/common.nix | 12 ++ | |
...sert-tab-to-the-right-of-current-tab.patch | 48 ++++++++ | |
.../disable-formatting-in-omnibox.patch | 15 +++ | |
...fely-treat-insecure-origin-as-secure.patch | 15 +++ | |
.../dont-let-mousewheel-switch-tabs.patch | 14 +++ | |
...w-exit-full-screen-context-menu-item.patch | 14 +++ | |
.../patches/ignore-pdf-permissions.patch | 39 ++++++ | |
.../make-ctrl-e-mute-unmute-site.patch | 32 +++++ | |
...emove-ctrl-shift-c-devtools-shortcut.patch | 25 ++++ | |
.../revert-commit-causing-tearing.patch | 114 ++++++++++++++++++ | |
.../patches/tweak-classic-theme.patch | 13 ++ | |
11 files changed, 341 insertions(+) | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/chromium-always-insert-tab-to-the-right-of-current-tab.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/disable-formatting-in-omnibox.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/dont-complain-about-unsafely-treat-insecure-origin-as-secure.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/dont-let-mousewheel-switch-tabs.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/dont-show-exit-full-screen-context-menu-item.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/ignore-pdf-permissions.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/make-ctrl-e-mute-unmute-site.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/remove-ctrl-shift-c-devtools-shortcut.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/revert-commit-causing-tearing.patch | |
create mode 100644 pkgs/applications/networking/browsers/chromium/patches/tweak-classic-theme.patch | |
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix | |
index ecf2c2e3676..8f395ff1e05 100644 | |
--- a/pkgs/applications/networking/browsers/chromium/common.nix | |
+++ b/pkgs/applications/networking/browsers/chromium/common.nix | |
@@ -131,6 +131,18 @@ let | |
./patches/widevine.patch | |
] ++ optionals (channel == "dev") [ | |
./patches/widevine-79.patch | |
+ ] ++ optionals (channel == "stable") [ | |
+ # Our patches frequently fail to apply to beta/dev | |
+ ./patches/disable-formatting-in-omnibox.patch | |
+ ./patches/chromium-always-insert-tab-to-the-right-of-current-tab.patch | |
+ ./patches/dont-let-mousewheel-switch-tabs.patch | |
+ ./patches/dont-show-exit-full-screen-context-menu-item.patch | |
+ ./patches/ignore-pdf-permissions.patch | |
+ ./patches/tweak-classic-theme.patch | |
+ ./patches/remove-ctrl-shift-c-devtools-shortcut.patch | |
+ ./patches/make-ctrl-e-mute-unmute-site.patch | |
+ ./patches/dont-complain-about-unsafely-treat-insecure-origin-as-secure.patch | |
+ ./patches/revert-commit-causing-tearing.patch | |
# Unfortunately, chromium regularly breaks on major updates and | |
# then needs various patches backported in order to be compiled with GCC. | |
# Good sources for such patches and other hints: | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/chromium-always-insert-tab-to-the-right-of-current-tab.patch b/pkgs/applications/networking/browsers/chromium/patches/chromium-always-insert-tab-to-the-right-of-current-tab.patch | |
new file mode 100644 | |
index 00000000000..de9994accd2 | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/chromium-always-insert-tab-to-the-right-of-current-tab.patch | |
@@ -0,0 +1,48 @@ | |
+diff --git a/chrome/browser/ui/tabs/tab_strip_model.cc b/chrome/browser/ui/tabs/tab_strip_model.cc | |
+index e81c3861ea89..77466317dbd2 100644 | |
+--- a/chrome/browser/ui/tabs/tab_strip_model.cc | |
++++ b/chrome/browser/ui/tabs/tab_strip_model.cc | |
+@@ -900,6 +900,9 @@ void TabStripModel::AddWebContents(std::unique_ptr<WebContents> contents, | |
+ add_types & ADD_ACTIVE); | |
+ inherit_opener = true; | |
+ } else { | |
++ // Convert -1 "end of tab bar" to "to the right of the current tab" | |
++ if (index == -1) | |
++ index = active_index() + 1; | |
+ // For all other types, respect what was passed to us, normalizing -1s and | |
+ // values that are too large. | |
+ if (index < 0 || index > count()) | |
+diff --git a/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc b/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc | |
+index 1347f88c23c2..c7efdc606f88 100644 | |
+--- a/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc | |
++++ b/chrome/browser/ui/tabs/tab_strip_model_order_controller.cc | |
+@@ -27,27 +27,8 @@ int TabStripModelOrderController::DetermineInsertionIndex( | |
+ if (!tab_count) | |
+ return 0; | |
+ | |
+- // NOTE: TabStripModel enforces that all non-mini-tabs occur after mini-tabs, | |
+- // so we don't have to check here too. | |
+- if (ui::PageTransitionCoreTypeIs(transition, ui::PAGE_TRANSITION_LINK) && | |
+- tabstrip_->active_index() != -1) { | |
+- if (foreground) { | |
+- // If the page was opened in the foreground by a link click in another | |
+- // tab, insert it adjacent to the tab that opened that link. | |
+- return tabstrip_->active_index() + 1; | |
+- } | |
+- content::WebContents* opener = tabstrip_->GetActiveWebContents(); | |
+- // Get the index of the next item opened by this tab, and insert after | |
+- // it... | |
+- int index = tabstrip_->GetIndexOfLastWebContentsOpenedBy( | |
+- opener, tabstrip_->active_index()); | |
+- if (index != TabStripModel::kNoTab) | |
+- return index + 1; | |
+- // Otherwise insert adjacent to opener... | |
+- return tabstrip_->active_index() + 1; | |
+- } | |
+- // In other cases, such as Ctrl+T, open at the end of the strip. | |
+- return tabstrip_->count(); | |
++ // Always open to the right of the current tab | |
++ return tabstrip_->active_index() + 1; | |
+ } | |
+ | |
+ int TabStripModelOrderController::DetermineNewSelectedIndex( | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/disable-formatting-in-omnibox.patch b/pkgs/applications/networking/browsers/chromium/patches/disable-formatting-in-omnibox.patch | |
new file mode 100644 | |
index 00000000000..f74e3fae6b1 | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/disable-formatting-in-omnibox.patch | |
@@ -0,0 +1,15 @@ | |
+diff --git a/components/url_formatter/url_formatter.cc b/components/url_formatter/url_formatter.cc | |
+index b060780004aa..b93f1242e2c9 100644 | |
+--- a/components/url_formatter/url_formatter.cc | |
++++ b/components/url_formatter/url_formatter.cc | |
+@@ -418,9 +418,7 @@ const FormatUrlType kFormatUrlOmitTrivialSubdomains = 1 << 5; | |
+ const FormatUrlType kFormatUrlTrimAfterHost = 1 << 6; | |
+ const FormatUrlType kFormatUrlOmitFileScheme = 1 << 7; | |
+ | |
+-const FormatUrlType kFormatUrlOmitDefaults = | |
+- kFormatUrlOmitUsernamePassword | kFormatUrlOmitHTTP | | |
+- kFormatUrlOmitTrailingSlashOnBareHostname; | |
++const FormatUrlType kFormatUrlOmitDefaults = 0; | |
+ | |
+ base::string16 FormatUrl(const GURL& url, | |
+ FormatUrlTypes format_types, | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/dont-complain-about-unsafely-treat-insecure-origin-as-secure.patch b/pkgs/applications/networking/browsers/chromium/patches/dont-complain-about-unsafely-treat-insecure-origin-as-secure.patch | |
new file mode 100644 | |
index 00000000000..bc3cc9fae9f | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/dont-complain-about-unsafely-treat-insecure-origin-as-secure.patch | |
@@ -0,0 +1,15 @@ | |
+diff --git a/chrome/browser/ui/startup/bad_flags_prompt.cc b/chrome/browser/ui/startup/bad_flags_prompt.cc | |
+index 1aade5ebccfe..870b14f1a28e 100644 | |
+--- a/chrome/browser/ui/startup/bad_flags_prompt.cc | |
++++ b/chrome/browser/ui/startup/bad_flags_prompt.cc | |
+@@ -105,10 +105,6 @@ static const char* kBadFlags[] = { | |
+ switches::kDisableBlinkFeatures, | |
+ switches::kEnableBlinkFeatures, | |
+ | |
+- // This flag allows people to whitelist certain origins as secure, even | |
+- // if they are not. | |
+- network::switches::kUnsafelyTreatInsecureOriginAsSecure, | |
+- | |
+ // This flag allows sites to access the camera and microphone without | |
+ // getting the user's permission. | |
+ switches::kUseFakeUIForMediaStream, | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/dont-let-mousewheel-switch-tabs.patch b/pkgs/applications/networking/browsers/chromium/patches/dont-let-mousewheel-switch-tabs.patch | |
new file mode 100644 | |
index 00000000000..02dd4e3f9ec | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/dont-let-mousewheel-switch-tabs.patch | |
@@ -0,0 +1,14 @@ | |
+--- a/chrome/browser/defaults.cc | |
++++ b/chrome/browser/defaults.cc | |
+@@ -43,11 +43,7 @@ const bool kSyncAutoStarts = true; | |
+ const bool kSyncAutoStarts = false; | |
+ #endif | |
+ | |
+-#if defined(OS_LINUX) && !defined(OS_CHROMEOS) | |
+-const bool kScrollEventChangesTab = true; | |
+-#else | |
+ const bool kScrollEventChangesTab = false; | |
+-#endif | |
+ | |
+ #if !defined(OS_ANDROID) | |
+ const bool kPasswordEchoEnabled = false; | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/dont-show-exit-full-screen-context-menu-item.patch b/pkgs/applications/networking/browsers/chromium/patches/dont-show-exit-full-screen-context-menu-item.patch | |
new file mode 100644 | |
index 00000000000..8a9baa75f2a | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/dont-show-exit-full-screen-context-menu-item.patch | |
@@ -0,0 +1,14 @@ | |
+diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc | |
+index 886c5d0b1a5e..a78252d8f963 100644 | |
+--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc | |
++++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc | |
+@@ -1315,7 +1315,8 @@ void RenderViewContextMenu::AppendPluginItems() { | |
+ } | |
+ | |
+ void RenderViewContextMenu::AppendPageItems() { | |
+- AppendExitFullscreenItem(); | |
++ // Disabled because it annoyingly shifts down the first "Back" item | |
++ // AppendExitFullscreenItem(); | |
+ | |
+ menu_model_.AddItemWithStringId(IDC_BACK, IDS_CONTENT_CONTEXT_BACK); | |
+ menu_model_.AddItemWithStringId(IDC_FORWARD, IDS_CONTENT_CONTEXT_FORWARD); | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/ignore-pdf-permissions.patch b/pkgs/applications/networking/browsers/chromium/patches/ignore-pdf-permissions.patch | |
new file mode 100644 | |
index 00000000000..4e138aefb03 | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/ignore-pdf-permissions.patch | |
@@ -0,0 +1,39 @@ | |
+--- a/pdf/pdfium/pdfium_engine.cc | |
++++ b/pdf/pdfium/pdfium_engine.cc | |
+@@ -2299,35 +2299,7 @@ std::string PDFiumEngine::GetLinkAtPosition(const pp::Point& point) { | |
+ } | |
+ | |
+ bool PDFiumEngine::HasPermission(DocumentPermission permission) const { | |
+- // PDF 1.7 spec, section 3.5.2 says: "If the revision number is 2 or greater, | |
+- // the operations to which user access can be controlled are as follows: ..." | |
+- // | |
+- // Thus for revision numbers less than 2, permissions are ignored and this | |
+- // always returns true. | |
+- if (permissions_handler_revision_ < 2) | |
+- return true; | |
+- | |
+- // Handle high quality printing permission separately for security handler | |
+- // revision 3+. See table 3.20 in the PDF 1.7 spec. | |
+- if (permission == PERMISSION_PRINT_HIGH_QUALITY && | |
+- permissions_handler_revision_ >= 3) { | |
+- return (permissions_ & kPDFPermissionPrintLowQualityMask) != 0 && | |
+- (permissions_ & kPDFPermissionPrintHighQualityMask) != 0; | |
+- } | |
+- | |
+- switch (permission) { | |
+- case PERMISSION_COPY: | |
+- return (permissions_ & kPDFPermissionCopyMask) != 0; | |
+- case PERMISSION_COPY_ACCESSIBLE: | |
+- return (permissions_ & kPDFPermissionCopyAccessibleMask) != 0; | |
+- case PERMISSION_PRINT_LOW_QUALITY: | |
+- case PERMISSION_PRINT_HIGH_QUALITY: | |
+- // With security handler revision 2 rules, check the same bit for high | |
+- // and low quality. See table 3.20 in the PDF 1.7 spec. | |
+- return (permissions_ & kPDFPermissionPrintLowQualityMask) != 0; | |
+- default: | |
+- return true; | |
+- } | |
++ return true; | |
+ } | |
+ | |
+ void PDFiumEngine::SelectAll() { | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/make-ctrl-e-mute-unmute-site.patch b/pkgs/applications/networking/browsers/chromium/patches/make-ctrl-e-mute-unmute-site.patch | |
new file mode 100644 | |
index 00000000000..e71f5965e4f | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/make-ctrl-e-mute-unmute-site.patch | |
@@ -0,0 +1,32 @@ | |
+From 0cb7d45f3976aea80a015ef0458e8448f499d748 Mon Sep 17 00:00:00 2001 | |
+From: Ivan Kozik <ivan@ludios.org> | |
+Date: Fri, 2 Aug 2019 04:32:18 +0000 | |
+Subject: [PATCH 2/2] Make ctrl-e mute/unmute the current site | |
+ | |
+--- | |
+ chrome/browser/ui/views/accelerator_table.cc | 2 +- | |
+ 1 file changed, 1 insertion(+), 1 deletion(-) | |
+ | |
+diff --git a/chrome/browser/ui/views/accelerator_table.cc b/chrome/browser/ui/views/accelerator_table.cc | |
+index de38a68932bd..1a44446373db 100644 | |
+--- a/chrome/browser/ui/views/accelerator_table.cc | |
++++ b/chrome/browser/ui/views/accelerator_table.cc | |
+@@ -102,6 +102,7 @@ const AcceleratorMapping kAcceleratorMap[] = { | |
+ #endif // OS_LINUX && !OS_CHROMEOS | |
+ {ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_PLATFORM_ACCELERATOR, | |
+ IDC_SHOW_BOOKMARK_BAR}, | |
++ {ui::VKEY_E, ui::EF_PLATFORM_ACCELERATOR, IDC_WINDOW_MUTE_SITE}, | |
+ {ui::VKEY_OEM_MINUS, ui::EF_PLATFORM_ACCELERATOR, IDC_ZOOM_MINUS}, | |
+ {ui::VKEY_SUBTRACT, ui::EF_PLATFORM_ACCELERATOR, IDC_ZOOM_MINUS}, | |
+ {ui::VKEY_0, ui::EF_PLATFORM_ACCELERATOR, IDC_ZOOM_NORMAL}, | |
+@@ -184,7 +185,6 @@ const AcceleratorMapping kAcceleratorMap[] = { | |
+ {ui::VKEY_A, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, | |
+ IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY}, | |
+ {ui::VKEY_D, ui::EF_ALT_DOWN, IDC_FOCUS_LOCATION}, | |
+- {ui::VKEY_E, ui::EF_CONTROL_DOWN, IDC_FOCUS_SEARCH}, | |
+ {ui::VKEY_K, ui::EF_CONTROL_DOWN, IDC_FOCUS_SEARCH}, | |
+ {ui::VKEY_T, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_TOOLBAR}, | |
+ {ui::VKEY_RIGHT, ui::EF_ALT_DOWN, IDC_FORWARD}, | |
+-- | |
+2.22.0 | |
+ | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/remove-ctrl-shift-c-devtools-shortcut.patch b/pkgs/applications/networking/browsers/chromium/patches/remove-ctrl-shift-c-devtools-shortcut.patch | |
new file mode 100644 | |
index 00000000000..ef8c332382e | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/remove-ctrl-shift-c-devtools-shortcut.patch | |
@@ -0,0 +1,25 @@ | |
+From f4f1ae52cea6282ce174d9f317ce2e6e7cdd1def Mon Sep 17 00:00:00 2001 | |
+From: Ivan Kozik <ivan@ludios.org> | |
+Date: Fri, 2 Aug 2019 04:28:12 +0000 | |
+Subject: [PATCH 1/2] Remove ctrl-shift-c devtools shortcut | |
+ | |
+--- | |
+ chrome/browser/ui/views/accelerator_table.cc | 2 -- | |
+ 1 file changed, 2 deletions(-) | |
+ | |
+diff --git a/chrome/browser/ui/views/accelerator_table.cc b/chrome/browser/ui/views/accelerator_table.cc | |
+index 53f1e63d0851..de38a68932bd 100644 | |
+--- a/chrome/browser/ui/views/accelerator_table.cc | |
++++ b/chrome/browser/ui/views/accelerator_table.cc | |
+@@ -180,8 +180,6 @@ const AcceleratorMapping kAcceleratorMap[] = { | |
+ {ui::VKEY_I, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, IDC_DEV_TOOLS}, | |
+ {ui::VKEY_J, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | |
+ IDC_DEV_TOOLS_CONSOLE}, | |
+- {ui::VKEY_C, ui::EF_SHIFT_DOWN | ui::EF_CONTROL_DOWN, | |
+- IDC_DEV_TOOLS_INSPECT}, | |
+ {ui::VKEY_B, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, IDC_FOCUS_BOOKMARKS}, | |
+ {ui::VKEY_A, ui::EF_SHIFT_DOWN | ui::EF_ALT_DOWN, | |
+ IDC_FOCUS_INACTIVE_POPUP_FOR_ACCESSIBILITY}, | |
+-- | |
+2.22.0 | |
+ | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/revert-commit-causing-tearing.patch b/pkgs/applications/networking/browsers/chromium/patches/revert-commit-causing-tearing.patch | |
new file mode 100644 | |
index 00000000000..1cae01581d5 | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/revert-commit-causing-tearing.patch | |
@@ -0,0 +1,114 @@ | |
+From cd0dc202be0a2b5964a920bc48bffd1bc2135c31 Mon Sep 17 00:00:00 2001 | |
+From: Ivan Kozik <ivan@ludios.org> | |
+Date: Sun, 22 Sep 2019 00:26:17 +0000 | |
+Subject: [PATCH] Revert "Always use the same visual for GLSurfaceGLX" | |
+ | |
+This reverts commit ec69eaf767f86d6fc1cd43f4800b0486e8d656af. | |
+--- | |
+ ui/gl/gl_surface_glx.cc | 41 ++++++++++++++++------------------------- | |
+ ui/gl/gl_surface_glx.h | 3 +++ | |
+ 2 files changed, 19 insertions(+), 25 deletions(-) | |
+ | |
+diff --git a/ui/gl/gl_surface_glx.cc b/ui/gl/gl_surface_glx.cc | |
+index b6028631de6c..88f9882c34c9 100644 | |
+--- a/ui/gl/gl_surface_glx.cc | |
++++ b/ui/gl/gl_surface_glx.cc | |
+@@ -461,12 +461,13 @@ bool GLSurfaceGLX::InitializeOneOff() { | |
+ return false; | |
+ } | |
+ | |
+- const auto& visual_info = gl::GLVisualPickerGLX::GetInstance()->rgba_visual(); | |
++ const auto& visual_info = gl::GLVisualPickerGLX::GetInstance()->system_visual(); | |
+ g_visual = visual_info.visual; | |
+ g_depth = visual_info.depth; | |
+ g_colormap = | |
+ XCreateColormap(gfx::GetXDisplay(), DefaultRootWindow(gfx::GetXDisplay()), | |
+ visual_info.visual, AllocNone); | |
++ | |
+ // We create a dummy unmapped window for both the main Display and the video | |
+ // sync Display so that the Nvidia driver can initialize itself before the | |
+ // sandbox is set up. | |
+@@ -592,6 +593,7 @@ NativeViewGLSurfaceGLX::NativeViewGLSurfaceGLX(gfx::AcceleratedWidget window) | |
+ window_(0), | |
+ glx_window_(0), | |
+ config_(nullptr), | |
++ visual_id_(CopyFromParent), | |
+ has_swapped_buffers_(false) {} | |
+ | |
+ bool NativeViewGLSurfaceGLX::Initialize(GLSurfaceFormat format) { | |
+@@ -603,30 +605,19 @@ bool NativeViewGLSurfaceGLX::Initialize(GLSurfaceFormat format) { | |
+ } | |
+ size_ = gfx::Size(attributes.width, attributes.height); | |
+ | |
+- XSetWindowAttributes swa = { | |
+- .background_pixmap = 0, | |
+- .background_pixel = 0, // ARGB(0,0,0,0) for compositing WM | |
+- .border_pixel = 0, | |
+- .bit_gravity = NorthWestGravity, | |
+- .colormap = g_colormap, | |
+- }; | |
+- 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; | |
+- } | |
+- | |
++ visual_id_ = XVisualIDFromVisual(attributes.visual); | |
++ // Create a child window, with a CopyFromParent visual (to avoid inducing | |
++ // extra blits in the driver), that we can resize exactly in Resize(), | |
++ // correctly ordered with GL, so that we don't have invalid transient states. | |
++ // See https://crbug.com/326995. | |
++ XSetWindowAttributes swa; | |
++ memset(&swa, 0, sizeof(swa)); | |
++ swa.background_pixmap = 0; | |
++ swa.bit_gravity = NorthWestGravity; | |
+ 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); | |
++ XCreateWindow(gfx::GetXDisplay(), parent_window_, 0, 0, size_.width(), | |
++ size_.height(), 0, CopyFromParent, InputOutput, | |
++ CopyFromParent, CWBackPixmap | CWBitGravity, &swa); | |
+ if (!window_) { | |
+ LOG(ERROR) << "XCreateWindow failed"; | |
+ return false; | |
+@@ -750,7 +741,7 @@ GLSurfaceFormat NativeViewGLSurfaceGLX::GetFormat() { | |
+ } | |
+ | |
+ unsigned long NativeViewGLSurfaceGLX::GetCompatibilityKey() { | |
+- return XVisualIDFromVisual(g_visual); | |
++ return visual_id_; | |
+ } | |
+ | |
+ gfx::SwapResult NativeViewGLSurfaceGLX::PostSubBuffer( | |
+diff --git a/ui/gl/gl_surface_glx.h b/ui/gl/gl_surface_glx.h | |
+index da2952013449..898e9cddacdd 100644 | |
+--- a/ui/gl/gl_surface_glx.h | |
++++ b/ui/gl/gl_surface_glx.h | |
+@@ -94,6 +94,8 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { | |
+ gfx::VSyncProvider* GetVSyncProvider() override; | |
+ void SetVSyncEnabled(bool enabled) override; | |
+ | |
++ VisualID GetVisualID() const { return visual_id_; } | |
++ | |
+ protected: | |
+ ~NativeViewGLSurfaceGLX() override; | |
+ | |
+@@ -124,6 +126,7 @@ class GL_EXPORT NativeViewGLSurfaceGLX : public GLSurfaceGLX { | |
+ | |
+ GLXFBConfig config_; | |
+ gfx::Size size_; | |
++ VisualID visual_id_; | |
+ | |
+ bool has_swapped_buffers_; | |
+ | |
+-- | |
+2.23.0 | |
+ | |
diff --git a/pkgs/applications/networking/browsers/chromium/patches/tweak-classic-theme.patch b/pkgs/applications/networking/browsers/chromium/patches/tweak-classic-theme.patch | |
new file mode 100644 | |
index 00000000000..86825dd8110 | |
--- /dev/null | |
+++ b/pkgs/applications/networking/browsers/chromium/patches/tweak-classic-theme.patch | |
@@ -0,0 +1,13 @@ | |
+diff --git a/chrome/browser/themes/theme_properties.cc b/chrome/browser/themes/theme_properties.cc | |
+index b8f6ae20bd8b..6d899f1eb019 100644 | |
+--- a/chrome/browser/themes/theme_properties.cc | |
++++ b/chrome/browser/themes/theme_properties.cc | |
+@@ -221,7 +221,7 @@ SkColor ThemeProperties::GetDefaultColor(int id, bool incognito) { | |
+ case COLOR_BACKGROUND_TAB_TEXT_INACTIVE: | |
+ case COLOR_BOOKMARK_TEXT: | |
+ case COLOR_TAB_TEXT: | |
+- return gfx::kGoogleGrey800; | |
++ return SK_ColorBLACK; | |
+ case COLOR_NTP_BACKGROUND: | |
+ return kDefaultColorNTPBackground; | |
+ case COLOR_NTP_TEXT: | |
-- | |
2.23.0 | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment