-
Notifications
You must be signed in to change notification settings - Fork 29.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixes #134612: Added electron flags for wayland #135191
Conversation
@deepak1556 can you please at least start the workflows for this PR? :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for working on this, left some style comments
Additionally it would be good to implement a |
e67c2e8
to
2cc4453
Compare
@deepak1556 I've fixed the things you mentioned but I couldn't understand what you said about |
src/main.js
Outdated
else if (argvValue === true || argvValue === 'true') { | ||
if (argvKey === 'disable-hardware-acceleration') { | ||
app.disableHardwareAcceleration(); // needs to be called explicitly | ||
} else { | ||
app.commandLine.appendSwitch(argvKey); | ||
} | ||
} | ||
|
||
// Other arguments with value type as 'string' | ||
else if (typeof argvValue === 'string') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
else if (typeof argvValue === 'string') { | |
// ozone platform | |
else if (argvKey === 'ozone-platform') { | |
if (argvValue) { | |
app.commandLine.appendSwitch(argvKey, argvValue); | |
app.commandLine.appendSwitch('enable-features', 'UseOzonePlatform'); | |
} | |
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
|
ozone-platform flag will be parsed from runtime argv.json file.
2cc4453
to
4116982
Compare
I would love to see this one merged! |
@deepak1556 is there any update on this one? :) |
Hi @deepak1556 is there any plan to merge this PR? |
Hi, I would like to use this patch. Is there anything blocking the merge and can I help in some way with finalizing this patch? |
Can be |
else if (argvKey === 'ozone-platform') { | ||
if (argvValue) { | ||
app.commandLine.appendSwitch(argvKey, argvValue); | ||
app.commandLine.appendSwitch('enable-features', 'UseOzonePlatform'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The UseOzonePlatform
feature no longer needs to be explicitly enabled since a couple of Electron releases ago, so this can be safely removed.
app.commandLine.appendSwitch('enable-features', 'UseOzonePlatform'); |
@@ -167,6 +167,9 @@ function configureCommandlineSwitchesSync(cliArgs) { | |||
|
|||
// Force enable screen readers on Linux via this flag | |||
SUPPORTED_ELECTRON_SWITCHES.push('force-renderer-accessibility'); | |||
|
|||
// Specify ozone platform implementation to use. | |||
SUPPORTED_ELECTRON_SWITCHES.push('ozone-platform'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since #154092, Visual Studio Code is using an Electron version that supports the --ozone-platform-hint
flag. So it may be worth enabling this flag too (ozone-platform-hint
) as part of this pull-request.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vially unfortunately we cannot support ozone-platform-hint
from application code since the flag detection happens before application code starts its execution which would be in ElectronBrowserMainParts::PreMainMessageLoopRun
Posting this here for visibility. I updated Electron to 19.0.10 locally to experiment with the new I'm not sure why VSCode sets it to the URL handler, as far as I can tell the URL handler works fine if it's set to the normal desktop file instead so I don't think that setting it to that is actually required for the URL handler. Ref (read the Electron dev comments as well as my own): electron/electron#34855 (comment) vscode/build/gulpfile.vscode.js Line 202 in 0ea1cfd
I'm mentioning this as part of this PR because the individuals involved in this PR are clearly interested in Wayland on Linux and this will need to be resolved if Wayland is made the default (for Wayland users) or even if it's exposed as an option directly. |
Sorry for the delay on this, looking into the changes again ozone platform initialization happens earlier https://github.com/electron/electron/blob/main/shell/browser/electron_browser_main_parts.cc#L220-L221 before entry point JS code of VSCode can run which makes it difficult to support this flag as an application configurable argument. Users are required to continue specifying either |
@deepak1556 When is going to be a default solution for people running wayland? Is there any issue tracking it? edit: maybe using this? electron/electron#34937 |
wayland is quickly becoming the default on linux distros. is there a long term plan to address this? |
vscode is the only reason I could not use fractional scaling in office with wayland... |
enable-features and the ozone-platform flag will be parsed from the runtime argv.json file.
This PR fixes #134612