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

DialogHost refresh issue on some computers (Surface laptop in this example) #1097

Closed
bebenins opened this issue Oct 29, 2018 · 11 comments
Closed

Comments

@bebenins
Copy link
Contributor

bebenins commented Oct 29, 2018

It does not happen on my old ThinkPad but it does happen on 2 Surface laptops I've tried.

This is the example in video: https://photos.app.goo.gl/kJjbu4wraiRJFVWH7
And this is repo of a slimmed down app that you can download and try: https://github.com/bebenins/DialogRefreshIssue

I'm pretty sure this started happening with 2.5.0 release because I noticed this one some dialogs once I updated to 2.5.0:
image

@jespersh
Copy link
Contributor

Could you try software rendering mode as a test?
https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.renderoptions.processrendermode?view=netframework-4.7.2

Adding in app.xaml.cs

protected override void OnStartup(StartupEventArgs e)
{
    RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
}

@bebenins
Copy link
Contributor Author

Could you try software rendering mode as a test?
https://docs.microsoft.com/en-us/dotnet/api/system.windows.media.renderoptions.processrendermode?view=netframework-4.7.2

Adding in app.xaml.cs

protected override void OnStartup(StartupEventArgs e)
{
    RenderOptions.ProcessRenderMode = System.Windows.Interop.RenderMode.SoftwareOnly;
}

Yep, that fixed it. So is this something to keep in mind or is there a way to "build" it into this toolkit and no one has to think about it again?
Thanks!

@jespersh
Copy link
Contributor

Sadly the issue is your hardware and/or drivers.
Mozilla maintains a public list of blocked hardware accelerated gpus. More details here: https://wiki.mozilla.org/Blocklisting/Blocked_Graphics_Drivers
Disabling it for everyone just because it doesn't work on a few gpus isn't very reasonable

@bebenins
Copy link
Contributor Author

There's still an issue with one type of dialog. I just updated the repo to include it. It's the 3rd button (Data Entry):
image

Any ideas what makes this special?
Thanks!

@jespersh
Copy link
Contributor

jespersh commented Nov 1, 2018

Your issue here is a rounding issue with the width
rounding-issue

If you in DialogDataEntry.xaml's UserControl add UseLayoutRounding="True" like this:

<UserControl x:Class="DialogRefreshIssue.DialogDataEntry"
             ...
             UseLayoutRounding="True">

Then it'll display it properly like this:
rounding-issue2

And Snoop now:
rounding-issue3

@bebenins
Copy link
Contributor Author

bebenins commented Nov 1, 2018

Thank you so much! I've learned something new today!

@bebenins
Copy link
Contributor Author

bebenins commented Nov 1, 2018

@jespersh Thank you again for helping with this. I'm trying to learn Snoop and having issues focusing on the Dialog. For some reason I don't see the same tree you are seeing even though the dialog is up. Could you please tell me how you focused on the dialog so that your tre starts with "(PopupRoot) 59"?
Thanks!
image

@Keboo
Copy link
Member

Keboo commented Nov 1, 2018

@bebenins the reason is because the tree view and snoop can only show a single visual tree at a time. Popups and windows each have their own tree. There is a slick little feature built into snoop where you simply hover your mouse over the element you want to select and press Ctrl+Shift. This should let you switch to inspecting the popup's tree.

@bebenins
Copy link
Contributor Author

bebenins commented Nov 1, 2018

@Keboo Thanks! Would have never guessed it

@jespersh
Copy link
Contributor

jespersh commented Nov 7, 2018

@bebenins is there more you need help with here? :-)

@bebenins
Copy link
Contributor Author

bebenins commented Nov 7, 2018

No I'm all set. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants