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

vscode flickering on mac (macbook air M1 ) while using with external display. #165681

Open
gitsameep opened this issue Nov 7, 2022 · 53 comments
Open
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug chromium Issues and items related to Chromium electron-19-update gpu Issues concerning GPU related items macos-ventura multi-monitor Issues with multiple display setups upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-pending Issues that are caused by chromium but have not been reported due to pending minimal repro

Comments

@gitsameep
Copy link

gitsameep commented Nov 7, 2022

Does this issue occur when all extensions are disabled?: Yes

  • VS Code Version: 1.73.0 (Universal)
  • OS Version: MacOS 13.0 (22A380) Apple M1

Steps to Reproduce:

  1. Connect your laptop with an external display.
  2. Use your vscode on fullscreen. (On any display)
  3. Start using your vscode, after sometime it will start happening. (No pattern here, Unable to reproduce consistently)
  4. Maybe switching between two displays triggers this issue. Not sure. (Like browser on main display then switch to vscode on another display and it happens)

Flickering happens on the main and external display as well. Flickering is random. Sometimes the screen goes black for a long (3-4 secs). Sometimes it flickers continuously.

Will publish more related videos. It's pretty random. Unable to record all situations.

VID_20221107_110756.mp4
@cevenkadir
Copy link

I have the same problem with my MBA M1.

@Bovey0809
Copy link

The same on mbp 14 m1pro

@wehype-jonas
Copy link

I am experiencing the same issues. Very problematic as it is occurring more frequently as of today for me. But the problem started when updating to MacOS 13.0

@deepak1556 deepak1556 added bug Issue identified by VS Code Team member as probable bug upstream Issue identified as 'upstream' component related (exists outside of VS Code) chromium Issues and items related to Chromium electron-19-update macos-ventura gpu Issues concerning GPU related items labels Dec 6, 2022
@kdubrovsky
Copy link

Same issues. MacBook Pro 16 and external Benq 4k display

@khanhmai20
Copy link

same issue

@dmo-code
Copy link

M1 Max MacBook Pro 16 and external Benq 4k display.

@Dylan-Ranger
Copy link

Yeah, same exact issue. M1 chip MacBook Pro 14 inch.

@deepak1556 deepak1556 added the multi-monitor Issues with multiple display setups label Jan 16, 2023
@eduelias
Copy link

Me too. Following.

@AlexDingleberries
Copy link

Me too, MBAM2 external Samsung monitor.

@deepak1556
Copy link
Contributor

Please try our exploration build based on newer runtime and confirm if the issue still persists. Thanks!

@deepak1556 deepak1556 added the info-needed Issue requires more information from poster label Jan 23, 2023
@cypressf
Copy link

cypressf commented Jan 26, 2023

Mine flickers very fast, in both the stable build and the exploration build. Gets worse or better depending on the window position.

Able to reproduce when

  • macOS was in dark mode
  • VS Code was set to the Dark+ (default dark)

I wasn't able to reproduce when VS Code was set to Dark+ V2 (Experimental), or when macOS was in light mode and VS Code was in Dark+ (default dark)

Laptop

MacBook Pro
14-inch, 2021
Apple M1 Pro
32 GB
macOS 13.1 (22065)

External Display

BenQ PD3220U, 4k 60hz, used as main display, macbook in clamshell mode

@deepak1556 deepak1556 added upstream-issue-pending Issues that are caused by chromium but have not been reported due to pending minimal repro and removed info-needed Issue requires more information from poster labels Jan 26, 2023
@aneelang
Copy link

aneelang commented Feb 5, 2023

Having the same issue lately

@kferrone
Copy link

The flicker is bad, gives me a headache.
I did find out it is partly because of the themes. Not always though, the themes seem to make it happen just more often.
Especially the kimbie dark theme. When it gets really bad, I must close everything and be on an empty desktop until it stops.

The external display on the macs hdmi port is the culprit. The laptop screen and the other connected with thunderbolt never flicker.

External Display: Asus VS247.

@zDEFz
Copy link

zDEFz commented Feb 19, 2023

https://forums.macrumors.com/threads/m1-air-ghosting-flickering-with-external-display.2271670/page-23

Having had my m1 mac for a long time, using my m1 mac mini as a headless server and for work I already switched to "normal" x86 machine. Problem is even worse when running asahilinux. But, hear me out: It is rumored that its a issue with EDID, which could mean that running your display with a capture card that has passthrough in between could actually help. Cost around 160 bucks ( e.g NZXT Signal 4K30 ) Alternatively could try a EDID Emulator device. But it could also be a regional issue - some machines may not have the issue, produced somewhere else.

Not always though, the themes seem to make it happen just more often. Especially the kimbie dark theme.

@kferrone thats absolutely correct. Those were also the findings in the link posted above...

@jagibson
Copy link

Happened to me on my M1 macbook pro after I switched from HDMI to USB-C/Displayport. After I switched away from "Solarized Dark" theme to "Dark+ V2 (Experimental)" the flickering went away.

@aneelang
Copy link

I doubt it has to do with the theme. Can you let me know if you don't have any flickering for the next couple days?

@dmo-code
Copy link

I have now switched back to HDMI from the MacBook.

Now the flickering is gone. Seems like it doesn't have anything with VS Code Theme. It seems to be a USB-C problem with a BenQ 4K monitor.

@jagibson
Copy link

@aneelang After looking at the video I think my issue is different. My flickering is much quicker than the reporter's. It almost looks like it's doing interlacing like an old TV, except it's vertical and not horizontal. Also it makes the whole monitor flicker even if code is only using half of the screen. It does not stop flickering until I change the theme or I remove "black" dialogs hovering over the main editor window.

I agree that it's not likely the theme but maybe it could be the rendering/contrast? I could get it to happen pretty consistently by doing the following:

  • Set my theme to "Solarized Dark" or "Solarized Dark+"
  • Open up the command dialog (Shift+Cmd+p)

Having the almost-black background of the dialog hover over the slightly lighter background of Solarized Dark seems to be the trigger. I tried a few other themes but couldn't re-create it as noticeably.

After I restarted Code today I could not reproduce the issue. I've had it open for several days including suspend/resumes.

Other notes

  • I have code in remote edit mode to a Linux host over SSH. I'm not sure if it's ever happened when just editing files locally.
  • I'm using a Dell S3221QS (4k) connected with a Plugable USB-TDP adapter.
  • I'm running Ventura 13.2.1

@zDEFz
Copy link

zDEFz commented Mar 22, 2023

@jagibson I absolutely have no evidence about what I'm about to say:
This is a issue with M Series devices which is triggered by certain colors/schemes which apple is unable to fix.
As pointed above, in the countless sub-links in the link I've posted: Changing the EDID sometimes had helped. But the real fix would be related to hardware, rather than software.

@AnalyticsWithScott
Copy link

I am having the same issue. The flickering on my screen is very rapid. Just bought a brand new MacBook Pro M1 Max 32 GB RAM and my screen flickers when I use full screen visual studio code with HDMI to an external LG monitor.

Will continue following.

@samuelan
Copy link

samuelan commented Apr 4, 2023

Update 4/4/2023. I replaced my Macbook. The technician said it was not vscode or any other software. It was the hardware related to the display.
The flickering and half screen goes black in non-deterministic fashion got worse last few days with or without the VScode running. I conclude it's not vs code.

@sdairs
Copy link

sdairs commented Apr 25, 2023

This absolutely is an issue with VS Code. No other app triggers this, and its happening to a lot of people.

M1 Mac, Dark theme (Solarized dark), external display (1440p 165Hz) over HDMI

@kferrone
Copy link

I found a workaround ... mostly. I make sure every workspace only has one single theme extension enabled. I went to all my workspaces and disabled all themes globally first. Then in each workspace, I only enable the extension for the theme I want in that workspace. This means all the others theme extensions are disabled.

If I enable every theme extension in a workspace and then choose a theme, the flicker will get bad. I am also suspicious of too many extensions in general so I only enable extensions selectively per workspace and have all global extensions disabled.

I blame extensions fighting with each-other.

@zDEFz
Copy link

zDEFz commented Apr 25, 2023

This absolutely is an issue with VS Code. No other app triggers this, and its happening to a lot of people.

M1 Mac, Dark theme (Solarized dark), external display (1440p 165Hz) over HDMI

I have a M1 Mac too and other apps trigger this as well
Correlation does not imply causation So which apps am I talking about? mostly electron/electron#8127 electron based ones. And it is most visible in dark scenes. But due to my experiences this is most likely related with the internal hardware. You might seen that they talk about a Nvidia GPU handling the display.

It is not really undermining the point I had made, rather a secondary possible cause. In some electron based apps like microsoft teams, it can help to deactivate the hardware acceleration.

Sometimes it is so bad it can trigger epileptic seizures... and thats not even on a M1 device, it's on a x86 lenovo thinkpad laptop.

But it is completely possible that a large quantity of electronics are faulty and won't be replaced with a working model / can't be fixed. It could also be possible that this issue is related to which batch you got and in which region you bought your device.

Of course: Those are the less common "individual cases"... right? By the way: I had screen related issues even when on Linux, booting from a M1 device. And they were even much more likely to show up. I suggest to get either a new apple device or start using a 'normal' x86 device.

FYI Theres also this https://www.eizoglobal.com/support/compatibility/pc/mac/apple-m1/ which is a statement regarding limitations about m1/m2 devices. But not so much related to flicker.

@ibreakthecloud
Copy link

happens with me too.
MacBook Pro M2 Pro
external monitor: LG

@LordAelfric
Copy link

This was happening to me when using a MacBook Pro (Apple M1 Pro, Ventura 13.4) and using a Samsung G9 Odyssey monitor in Pip mode (split screen). It would cause my other split to flash and be very distracting. It would only happen when the terminal window was visible on the Mac. You could resize the window to zero height or close it entirely and it would stop happening.

To solve this, I changed my theme from Dark Modern to Dark+.

@jagibson
Copy link

I think @zDEFz is right - the issue is deeper than vscode. I had it happen with Microsoft Remote Desktop (another MS product?) when connecting to a remote server that had just the right subdued colors.

@zDEFz
Copy link

zDEFz commented May 25, 2023

Not a recommendation, just an observation.

I've checked on the thread I've posted before once again. There is a person claiming to have found a fix with 'technically an external GPU'

https://forums.macrumors.com/threads/m1-m2-flickering-ghosting-with-external-display-merged.2271670/post-32017012

I haven't tried it personally. It involves buying a 140 EUR adapter OWCCADPDL2HDMI https://www.amazon.de/OWC-Display-DISPLAYLINK-Thunderbolt-OWCCADPDL2HDMI/dp/B09RMVL865 and a 10 EUR HDMI Emulator.

---snip---
Pros:

  • Peace of mind

Cons:

  • 140 EUR for the adapter
  • 10 EUR for the HDMI emulator
  • Occasional artifacts, probably from the experimental 3008x and 2560x modes of the DL driver
  • Blind typing of the password at boot and reboot
    ---snip---

@kferrone
Copy link

The flicker is even worse when you are already feeling nauseous. Uggh, this about made me puke today. Just wait till someone has epilepsy and comes across this one.

@zDEFz
Copy link

zDEFz commented Jun 21, 2023

The flicker is even worse when you are already feeling nauseous. Uggh, this about made me puke today. Just wait till someone has epilepsy and comes across this one.

Not all triggers are visual. Any type of stress can trigger epilepsy as well.

@justinhernandez
Copy link

justinhernandez commented Jul 2, 2023

Potential fix: Switch color profile to "Generic RGB Profile", it worked for my m2 laptop + external monitor [reddit]

Screenshot 2023-07-02 at 11 42 07 AM

@achyutzeni
Copy link

For me switching the theme Dark+ worked as a temp fix for the flickering on my BenQ 4K external monitor.

@jhadida
Copy link

jhadida commented Sep 18, 2023

Disabling the "True Tone" option in system preferences seemingly fixed the flickering for me.
In my case it was a scroll-dependent flicker visible mainly in the status bar at the bottom of the VSCode window, as well as the accordion section titles in the sidebar.

Laptop: MBP 14in M2 Max
Monitor: BenQ EW3280U (USB-C)
VSCode: 1.82.2
Electron: 25.8.1
ElectronBuildId: 23779380
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin arm64 22.6.0

@prpetten
Copy link

prpetten commented Sep 19, 2023

I was getting the flickering pretty bad with an older (2018, non-Apple Silicon) MBP

Model: MBP 15in 2.6 GHz 6-Core Intel Core i7
Monitor: AOC U2790B
VSCode: 1.82.0
Version: 1.82.0
Electron: 25.8.0
ElectronBuildId: 23503258
Chromium: 114.0.5735.289
Node.js: 18.15.0
V8: 11.4.183.29-electron.0
OS: Darwin x64 22.6.0

UPDATE
This solved my issue:

I fixed the problem by disabling automatic graphics switching on my macbook pro.
The setting is located in system preferences -> battery.
It worked!

https://stackoverflow.com/questions/29966747/how-can-i-disable-gpu-rendering-in-visual-studio-code

@spockoyno
Copy link

spockoyno commented Oct 21, 2023

These two combined steps worked for me:

  1. For the monitor, set the Color Profile to Generic RGB Profile as in this suggestion
  2. Use the monitor's default resolution, rather than scaled.

@lgo
Copy link

lgo commented Oct 25, 2023

I recently ran into this with a Samsung LF32TU87 monitor. While setting the Color profile did not resolve the problem, using the native resolution did. Thank you spockoyno!

@tudor
Copy link

tudor commented Oct 26, 2023

The one thing that worked for me was disabling GPU rendering. Preferences: Configure Runtime Arguments, add "disable-hardware-acceleration": true

@rvanxer
Copy link

rvanxer commented Nov 7, 2023

I was getting the flickering pretty bad with an older (2018, non-Apple Silicon) MBP

Model: MBP 15in 2.6 GHz 6-Core Intel Core i7 Monitor: AOC U2790B VSCode: 1.82.0 Version: 1.82.0 Electron: 25.8.0 ElectronBuildId: 23503258 Chromium: 114.0.5735.289 Node.js: 18.15.0 V8: 11.4.183.29-electron.0 OS: Darwin x64 22.6.0

UPDATE This solved my issue:

I fixed the problem by disabling automatic graphics switching on my macbook pro.
The setting is located in system preferences -> battery.
It worked!

https://stackoverflow.com/questions/29966747/how-can-i-disable-gpu-rendering-in-visual-studio-code

This worked for me, though scrolling seems not so smooth now. But it's much better than that flickering.

@adamwdennis
Copy link

This resolved it for me...
With VSCode open:

  1. Open the command palette: {CMD}+{SHIFT}+P
  2. Open the configuration file: type "Preferences : Configure Runtime Arguments"
  3. Change the property "disable-color-correct-rendering" to false.

@misha-antonenko
Copy link

Apparently, "disable-color-correct-rendering" was removed from both Electron and VSCode in recent versions

@zDEFz
Copy link

zDEFz commented Jan 16, 2024

To sum it up - Apple did mess something up, and it is working if it doesn't use Apples implementation?

@notsoluckycharm
Copy link

notsoluckycharm commented Jan 17, 2024

For me, changing the resolution ratio worked on my Dell. It didn't like the intermediary options. I had to scale it all the way until it matched a native resolution of the monitor. This makes sense to me. Apple seems to be generating resolutions based on UX, rather than hardware capability.

@zDEFz
Copy link

zDEFz commented Jan 17, 2024

For me, changing the resolution ratio worked on my Dell. It didn't like the intermediary options. I had to scale it all the way until it matched a native resolution of the monitor.

You know, its all kind of weird. On my older macbook pro from 2016, after update to ventura/sonoma, Microsoft Teams is only usable through the Browser if NO external display is connected. Otherwise, the whole application becomes non-interactable.

@panos-dimitriadis
Copy link

panos-dimitriadis commented Jan 29, 2024

In my case the flickering stated after the sonora update (M1 max pro laptop on a 4k asus monitor), and stopped when i disabled the hardware acceleration from Preferences : Configure Runtime Arguments

@DeviousM
Copy link

So, is there no solution to this except for disabling the hardware acceleration, which by itself comes at a cost of reduced performance?

@zDEFz
Copy link

zDEFz commented Mar 26, 2024

So, is there no solution to this except for disabling the hardware acceleration, which by itself comes at a cost of reduced performance?

These are all guesses. What works for you might not for others.

On top, you have issues if you do not use apple displays.

Why? Well, because apple does do their own stuff. See https://social.treehouse.systems/@marcan/112129842235465322

@simonetgordon
Copy link

These two combined steps worked for me:

  1. For the monitor, set the Color Profile to Generic RGB Profile as in this suggestion
  2. Use the monitor's default resolution, rather than scaled.

MacBook Pro M1, Dell external monitor. I tried various other things mentioned on this thread, but in the end, switching from scaled -> default resolution on the monitor worked. Flickering was pretty bad, triggered by scrolling and typing.

@maxerbubba
Copy link

Intel Macbook Ventura 13.6.6 -> Turning off "Zoom per window" fixed it for me. Having multiple windows/split windows makes it worse.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue identified by VS Code Team member as probable bug chromium Issues and items related to Chromium electron-19-update gpu Issues concerning GPU related items macos-ventura multi-monitor Issues with multiple display setups upstream Issue identified as 'upstream' component related (exists outside of VS Code) upstream-issue-pending Issues that are caused by chromium but have not been reported due to pending minimal repro
Projects
None yet
Development

No branches or pull requests