-
Notifications
You must be signed in to change notification settings - Fork 8.2k
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
Profile icons not displayed when initialPosition is set to a value, that opens terminal on a second monitor #14954
Comments
oh my god you've totally figured out the root cause of #14339, haven't you? @awakecoding you were seeing that too, right? Did you have two monitors? |
I usually have 3 monitors with mixed DPI: my laptop as primary display in the middle with high dpi, and two external displays on the sides. This is guaranteed to trigger a lot of bugs in all software (you wouldn't believe how the Windows 11 Explorer still has issues with it) |
@zadjii-msft Oh sorry for duplicate issue. I was looking for one and couldn't find one. To my scenario: |
No worries! Honestly, I might close the other one in favor of this thread. The other thread is all "it no worky", while this thread actually has a root cause and concrete repro steps. |
I've managed to find the conditions required to hit this bug 100% of the time, and it happens with the official Microsoft Windows Terminal zip package. You need mixed DPI displays, which is easy to get with a high DPI laptop display and external low DPI monitors like this: Download and extract the Windows Terminal zip, and have it ready in the file explorer. Move the file explorer window to either one of the low DPI displays in such a configuration and double-click WindowsTerminal.exe or wt.exe and you'll have missing icons. Move the file explorer to the high DPI display in the middle and do the same, and it'll always render those icons. Here's an interesting twist: if I change my laptop display to 1920x1080 (low dpi) then the issue doesn't manifest itself. It really needs a primary high DPI display for the bug to occur only when the initial display is one of the non-primary DPI displays. Moving the file explorer window to the display you want to use appears sufficient to make that display the initial one when launching Windows Terminal from there. |
I just noticed something interesting: in my case, only the icons defined using ms-appx:// URLs are affected: Those icons are from the ProfileIcons directory alongside Windows Terminal. In that screenshot, Ubuntu 22.04 uses the generic Linux profile icon (ms-appx:///ProfileIcons/{9acb9455-ca41-5af7-950f-6bca1bc9722f}.png), while Ubuntu 20.04 uses an external icon with an HTTPS URL (https://assets.ubuntu.com/v1/49a1a858-favicon-32x32.png). This distinction may be important to find the root cause of the icon loading bug. |
I figured that I could set an explicit initial position for Windows Terminal instead of letting Windows decide, making it much easier to reproduce the issue. The profile icon files are definitely loaded from disk, and we can see the call stack deep into Windows.UI.Xaml.dll from Process Monitor on those: I've managed to record a time travel trace of Windows Terminal and put breakpoints in that call stack, but I couldn't really figure out anything obvious. I'm thinking the images are loaded from the files but the issue would be something to do with UI threads and rendering. There's a lot of sketchy async stuff with comments about certain things needing to run on specific threads.
Are we sure it's all running in the correct thread for the icon loading, and what would be the easiest way to tell if it's wrong? What about this weird hack to avoid crashing by setting non-null icon sources? Could this be the cause of the problem? |
Great, I 'fixed' the issue by manually choosing icons from external files, thanks to your comment 🤓 |
Windows Terminal version
1.16.10261.0
Windows build number
10.0.19044.2604
Other Software
No response
Steps to reproduce
You need two monitors. The monitor on the left ist the primary display, the right monitor is the second display.
settings.json
and add the following line (before the "profile" attribute):Expected Behavior
I expected to see all profile icons, even if the terminal starts on a second screen.
In the settings window, all icons are always diplayed correctly.
Actual Behavior
The text was updated successfully, but these errors were encountered: