Skip to content

Commit

Permalink
add workaround for <canvas> rendering problem
Browse files Browse the repository at this point in the history
  • Loading branch information
rhysd committed Feb 27, 2016
1 parent 5c0d0b7 commit d95bc9a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
16 changes: 16 additions & 0 deletions main/browser-config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface BrowserConfigJson {
remember_window_state: boolean;
window_options: Electron.BrowserWindowOptions;
single_instance: boolean;
enable_canvas_workaround: boolean;
}

export default class BrowserConfig {
Expand Down Expand Up @@ -99,4 +100,19 @@ export default class BrowserConfig {
return true;
});
}

configCanvasWorkaround() {
if (this.loaded_config === null || !this.loaded_config.enable_canvas_workaround) {
return;
}

// Note:
// Avoid <canvas> rendering problem.
//
// https://github.com/rhysd/NyaoVim/issues/3
// https://github.com/atom/electron/issues/4594
//
app.commandLine.appendArgument('--use-gl=egl');
process.env.MESA_GLSL_VERSION_OVERRIDE = '1.30';
}
}
2 changes: 2 additions & 0 deletions main/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ const prepare_browser_config
function startMainWindow() {
'use strict';

browser_config.configCanvasWorkaround();

const index_html = 'file://' + join(__dirname, '..', 'renderer', 'main.html');

const default_config = {
Expand Down

0 comments on commit d95bc9a

Please sign in to comment.