Skip to content
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

Help please: how to set electron window frame to false #236

Open
hologerry opened this issue Oct 14, 2024 · 5 comments
Open

Help please: how to set electron window frame to false #236

hologerry opened this issue Oct 14, 2024 · 5 comments
Labels

Comments

@hologerry
Copy link

Hi,
I am new to here, previously I used apc-extension to achieve frameless title bar and solve the 1px top white line drcika/apc-extension#169 microsoft/vscode#144389:

"apc.electron": {
    "frame": false,
    "transparent": true,
}

However, the apc-extension is broken by the VSCode's latest version drcika/apc-extension#230.
May I ask how to do so with vscode-custom-css?
Thanks a lot!

@shahzaibkhalid
Copy link

Also looking to do the same!

@hologerry
Copy link
Author

hologerry commented Oct 15, 2024

I found a monkey patch solution for this:
Change the file /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js

  1. open this file and format it to readable (just open the folder out with VSCode and format it).
  2. change this part:
l = {
      backgroundColor: r.getBackgroundColor(),
      minWidth: wp.WIDTH,
      minHeight: wp.HEIGHT,
      title: n.nameLong,
      show: e.mode !== 0 && e.mode !== 3,
      x: e.x,
      y: e.y,
      width: e.width,
      height: e.height,
      webPreferences: {
        ...s,
        enableWebSQL: !1,
        spellcheck: !1,
        zoomFactor: Tl(e.zoomLevel ?? c?.zoomLevel),
        autoplayPolicy: "user-gesture-required",
        enableBlinkFeatures: "HighlightAPI",
        sandbox: !0,
      },
      experimentalDarkMode: !0,
    };

to

l = {
      backgroundColor: r.getBackgroundColor(),
      minWidth: wp.WIDTH,
      minHeight: wp.HEIGHT,
      title: n.nameLong,
      show: e.mode !== 0 && e.mode !== 3,
      x: e.x,
      y: e.y,
      width: e.width,
      height: e.height,
      webPreferences: {
        ...s,
        enableWebSQL: !1,
        spellcheck: !1,
        zoomFactor: Tl(e.zoomLevel ?? c?.zoomLevel),
        autoplayPolicy: "user-gesture-required",
        enableBlinkFeatures: "HighlightAPI",
        sandbox: !0,
      },
      experimentalDarkMode: !0,
      frame: false,
      transparent: true,
    };

@shahzaibkhalid
Copy link

I found a monkey patch solution for this: Change the file /Applications/Visual Studio Code.app/Contents/Resources/app/out/vs/code/electron-main/main.js

  1. open this file and format it to readable (just open the folder out with VSCode and format it).
  2. change this part:
l = {
      backgroundColor: r.getBackgroundColor(),
      minWidth: wp.WIDTH,
      minHeight: wp.HEIGHT,
      title: n.nameLong,
      show: e.mode !== 0 && e.mode !== 3,
      x: e.x,
      y: e.y,
      width: e.width,
      height: e.height,
      webPreferences: {
        ...s,
        enableWebSQL: !1,
        spellcheck: !1,
        zoomFactor: Tl(e.zoomLevel ?? c?.zoomLevel),
        autoplayPolicy: "user-gesture-required",
        enableBlinkFeatures: "HighlightAPI",
        sandbox: !0,
      },
      experimentalDarkMode: !0,
    };

to

l = {
      backgroundColor: r.getBackgroundColor(),
      minWidth: wp.WIDTH,
      minHeight: wp.HEIGHT,
      title: n.nameLong,
      show: e.mode !== 0 && e.mode !== 3,
      x: e.x,
      y: e.y,
      width: e.width,
      height: e.height,
      webPreferences: {
        ...s,
        enableWebSQL: !1,
        spellcheck: !1,
        zoomFactor: Tl(e.zoomLevel ?? c?.zoomLevel),
        autoplayPolicy: "user-gesture-required",
        enableBlinkFeatures: "HighlightAPI",
        sandbox: !0,
      },
      experimentalDarkMode: !0,
      frame: false,
      transparent: true,
    };

Finally got to like VSCode again, thank you!

@Blankeos
Copy link

Monkey patch doesn't work for me D:

Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 15 days.

@github-actions github-actions bot added the stale label Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants