microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.77k stars 29.11k forks source link

VS Code causes my monitor to dim and become blurry #183619

Closed umarbutler closed 1 year ago

umarbutler commented 1 year ago

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

Steps to Reproduce:

  1. Open vscode with a HDR-enabled monitor.
btgoodwin commented 1 year ago

I'm having a similar problem on 1.70.0 and 1.80.3 right now (just updated hoping that would fix it).

I turned HDR off on my monitor's internal settings after disabling those settings in Windows 11 (21H2) so that now I'm entirely running in SD. If VSCode is taking up less than half the screen, all the colors across the monitor look fine. The moment the VSCode window is expanded to take more than half the pixels on the screen, it's like something has come along and increased the contrast and brightness of the whole display (however, no changes appear in my monitor's onboard settings, so this isn't some DDC communication to the monitor, this is purely a software thing somewhere in Windows or an app).

I have found nothing online about "auto hdr" pertaining to this and since it's completely disabled now, I don't understand why this would be happening specifically and only with VSCode. It's making the app unusable because I need it full-screen so I can see my work, but when I do so, the colors saturate so much it hurts my eyes unless I then go adjust the monitor's settings. Once I reduce the size of the vscode instance, suddenly everything goes gray as whatever is doing this stops doing it...then I have to go change my monitor's settings again so I can actually read the screen.

btgoodwin commented 1 year ago

Just now I changed my color theme from Dark (Visual Studio Code - C++) to Monokai, a third-party theme and the problem went away entirely. I've now cycled through several of the other themes, light and dark, which I did not download myself and they all exhibit this weird issue of changing the contrast and brightness of the entire display when this one single app is taking up the majority of the screen and focused.

bobbrow commented 1 year ago

Hello, I'm chiming in for the C++ extension. We're not sure how our extension could be the cause of this HDR mode switching. I don't see any mention of HDR on the extension guide and have always expected hex color values to be interpreted as living in the sRGB color space. If there is something we need to do on our side, please let us know and we can release an update to our themes.

deepak1556 commented 1 year ago

@btgoodwin can you check if the issue happens with our exploration builds based on a newer version of the runtime.

@bobbrow the themes API is owned by @aeschli who is currently on vacation, he should be able to answer your question.

btgoodwin commented 1 year ago

@deepak1556 I downloaded your linked version, opened only the app and switched to the Dark (Visual Studio) theme, then maximized the window. It exhibits the same behavior, slowly fading up to some new brightness and contrast values that saturate the whole screen.

deepak1556 commented 1 year ago

Do you see the same behavior when running https://vscode.dev in your browser ? This seems like a runtime issue, can you provide the output of following commands from powershell

$ Get-WmiObject win32_desktopMonitor
$ Get-WmiObject win32_videoController | select Caption, VideoModeDescription
$ $displayParams = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams
$ $displayParams.SupportedDisplayFeatures
btgoodwin commented 1 year ago

Thank you, I'll try your suggestion later and report back once I'm in front of the monitor again. I have a few more data points that have me suspicious of the thunderbolt dock sitting between the computer and the monitor (thunderbolt -> dock -> HDMI -> monitor).

Last night I plugged in an M2 Max macbook prog into the same dock and was able to repro the same behavior in macOS Ventura 13.5 using VSCode and iTerm (it was configured to a black background). Interestingly the problem was showing up when I moved the relatively small iTerm window around to different parts of the screen (vs. just expanding it to be larger, which also reproduced the problem).

I then grabbed another Windows 11 computer and connected it directly to the monitor via HDMI, installed VSCode and could not reproduce the issue at all.

Now this morning, with that same laptop where I first discovered the issue, I'm at a different thunderbolt dock and monitor (still SDR and HDMI), and I cannot reproduce the issue.

For the sake of documenting this, here are the outputs of those commands on this working case (original laptop, Lenovo dock, LG monitor):

C:\Users\someone> Get-WmiObject win32_desktopMonitor

DeviceID            : DesktopMonitor1
DisplayType         :
MonitorManufacturer : (Standard monitor types)
Name                : Generic PnP Monitor
ScreenHeight        :
ScreenWidth         :

DeviceID            : DesktopMonitor2
DisplayType         :
MonitorManufacturer : Lenovo
Name                : Wide viewing angle & High density FlexView Display 1920x1080
ScreenHeight        : 1080
ScreenWidth         : 1920

C:\Users\someone> Get-WmiObject win32_videoController | select Caption, VideoModeDescription

Caption                                   VideoModeDescription
-------                                   --------------------
NVIDIA GeForce GTX 1650 with Max-Q Design 3440 x 1440 x 4294967296 colors
Intel(R) UHD Graphics 630                 1920 x 1080 x 4294967296 colors

C:\Users\someone> $displayParams = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams
C:\Users\someone> $displayParams.SupportedDisplayFeatures

ActiveOffSupported     : True
DisplayType            : 0
GTFSupported           : False
HasPreferredTimingMode : True
sRGBSupported          : False
StandbySupported       : True
SuspendSupported       : True
PSComputerName         :

ActiveOffSupported     : True
DisplayType            : 3
GTFSupported           : False
HasPreferredTimingMode : True
sRGBSupported          : True
StandbySupported       : True
SuspendSupported       : True
PSComputerName         :

The response about the attached monitor is interesting to me. In the Windows display settings, under advanced it lists the name as LG HDR WQHD with:

Bit depth: 8-bit
Color format: RGB
Color Space: Standard dynamic range (SDR)

I'll run this again tonight when I'm back in front of the original dock and monitor. Plugged into the hub and monitor exhibiting the behavior, the outputs are:

C:\Users\someone> Get-WmiObject win32_desktopMonitor

DeviceID            : DesktopMonitor1
DisplayType         :
MonitorManufacturer : Dell Inc.
Name                : Dell S3221QS(HDMI2)
ScreenHeight        :
ScreenWidth         :

DeviceID            : DesktopMonitor2
DisplayType         :
MonitorManufacturer : Lenovo
Name                : Wide viewing angle & High density FlexView Display 1920x1080
ScreenHeight        : 1080
ScreenWidth         : 1920

C:\Users\someone> Get-WmiObject win32_videoController | select Caption, VideoModeDescription

Caption                                   VideoModeDescription
-------                                   --------------------
NVIDIA GeForce GTX 1650 with Max-Q Design 3840 x 2160 x 4294967296 colors
Intel(R) UHD Graphics 630                 1920 x 1080 x 4294967296 colors

C:\Users\someone> $displayParams = Get-CimInstance -Namespace root\wmi -ClassName WmiMonitorBasicDisplayParams
C:\Users\someone> $displayParams.SupportedDisplayFeatures

ActiveOffSupported     : True
DisplayType            : 0
GTFSupported           : False
HasPreferredTimingMode : True
sRGBSupported          : False
StandbySupported       : True
SuspendSupported       : True
PSComputerName         :

ActiveOffSupported     : True
DisplayType            : 1
GTFSupported           : False
HasPreferredTimingMode : True
sRGBSupported          : False
StandbySupported       : True
SuspendSupported       : True
PSComputerName         :
btgoodwin commented 1 year ago

The responses from the tower that is directly connected via HDMI and does not exhibit the problem has essentially identical responses to the second set, above, except that the graphics card is rightly reported as a 6900xt and there's no internal display.

Directly connecting the laptop to the display via the same HDMI cable makes the problem go away.

I'm stumped as to why it is only certain applications causing the behavior with this specific dock, but I guess that lets VSCode off the hook for my somewhat similar issue to the OP's. I would be happy to debug further if anyone is interested, but it's safe to say my issue is probably not the OP's.

The dock in question is this Pluggable 11-in-1 USB4/Thunderbolt 100W.

deepak1556 commented 1 year ago

Thanks for narrowing down the source of issue in your case, @umarbutler do you still experience the issue with latest stable ?

vscodenpa commented 1 year ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!