From c20b242ac63202a8b6fd62334eb8024c0a173321 Mon Sep 17 00:00:00 2001 From: Azvya Erstevan Date: Tue, 13 Aug 2024 21:37:26 +0700 Subject: [PATCH] misc: allow HiDPI Screen running wayland to use cypress window/browser (#29366) * misc: allow HiDPI Screen running wayland to use cypress window/browser * Added changelog entry * Fix changelog entry release date to pending * Changed release changelog entry to actual date * Added issue number to the changelog entry * fix tests * update changelog --------- Co-authored-by: Ryan Manuel --- cli/CHANGELOG.md | 1 + cli/lib/exec/spawn.js | 2 +- cli/test/lib/exec/spawn_spec.js | 4 ++++ 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/CHANGELOG.md b/cli/CHANGELOG.md index a2f77a18347b..4a3543681f91 100644 --- a/cli/CHANGELOG.md +++ b/cli/CHANGELOG.md @@ -11,6 +11,7 @@ _Released 8/13/2024 (PENDING)_ **Misc:** - Updated `cypress open` hints displayed after Cypress binary install. Addresses [#29935](https://github.com/cypress-io/cypress/issues/29935). +- Allow HiDPI Screen running wayland to use cypress window/browser by adding `--ozone-platform=auto` flag to the electron's runtime argument. Addresses [#20891](https://github.com/cypress-io/cypress/issues/20891). ## 13.13.2 diff --git a/cli/lib/exec/spawn.js b/cli/lib/exec/spawn.js index e132b964e0a3..63c7312677b3 100644 --- a/cli/lib/exec/spawn.js +++ b/cli/lib/exec/spawn.js @@ -155,7 +155,7 @@ module.exports = { const { onStderrData } = overrides const envOverrides = util.getEnvOverrides(options) - const electronArgs = [] + const electronArgs = ['--ozone-platform=auto'] const node11WindowsFix = isPlatform('win32') let startScriptPath diff --git a/cli/test/lib/exec/spawn_spec.js b/cli/test/lib/exec/spawn_spec.js index 26ad6d6713e7..1c85deb9c8d4 100644 --- a/cli/test/lib/exec/spawn_spec.js +++ b/cli/test/lib/exec/spawn_spec.js @@ -121,6 +121,7 @@ describe('lib/exec/spawn', function () { return spawn.start('--foo', { foo: 'bar' }) .then(() => { expect(cp.spawn).to.be.calledWithMatch('/path/to/cypress', [ + '--ozone-platform=auto', '--', '--foo', '--cwd', @@ -148,6 +149,7 @@ describe('lib/exec/spawn', function () { const args = cp.spawn.firstCall.args.slice(0, 2) // it is important for "--no-sandbox" to appear before "--" separator const expectedCliArgs = [ + '--ozone-platform=auto', '--no-sandbox', '--', '--foo', @@ -173,6 +175,7 @@ describe('lib/exec/spawn', function () { .then(() => { expect(cp.spawn).to.be.calledWithMatch('node', [ p, + '--ozone-platform=auto', '--', '--foo', '--cwd', @@ -198,6 +201,7 @@ describe('lib/exec/spawn', function () { .then(() => { expect(cp.spawn).to.be.calledWithMatch('node', [ p, + '--ozone-platform=auto', '--', '--foo', '--cwd',