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

Remove assertions from Windows dark mode code #1459

Merged
merged 9 commits into from
Mar 7, 2020

Conversation

chrisduerr
Copy link
Contributor

@chrisduerr chrisduerr commented Feb 13, 2020

In general, winit should never assert on anything unless it means that
it is impossible to continue the execution of the program. There are
several assertions in the Windows dark mode code where this is not the
case.

Based on surface level inspection, all existing assertions could be
easily replaced with just simple conditional checks, allowing the
execution of the program to proceed with sane default values.

Fixes #1458.
Fixes #1405.

src/platform_impl/windows/dark_mode.rs Outdated Show resolved Hide resolved
@daxpedda
Copy link
Member

Fixes #1405 too.

I would like to know what the error actually is, @chrisduerr mentions in #1458 that it happens in Windows 10 Enterprise LTSC 1809, which I tried and can't reproduce.

So if someone can try using std::io::Error::last_os_error() as mentioned above and report back it would be amazing.

@chrisduerr
Copy link
Contributor Author

@daxpedda If you test Windows 10 1809 10.0.17763.1, you should be able to reproduce. It's not the latest version of Windows 10 1809.

chrisduerr and others added 9 commits March 7, 2020 01:33
In general, winit should never assert on anything unless it means that
it is impossible to continue the execution of the program. There are
several assertions in the Windows dark mode code where this is not the
case.

Based on surface level inspection, all existing assertions could be
easily replaced with just simple conditional checks, allowing the
execution of the program to proceed with sane default values.

Fixes rust-windowing#1458.
Co-Authored-By: daxpedda <daxpedda@gmail.com>
@chrisduerr chrisduerr force-pushed the fix-windows-assert branch from 286e8ef to 3844d9d Compare March 7, 2020 00:34
@chrisduerr
Copy link
Contributor Author

@ryanisaacg Since you were so helpful with testing the modifier PR, could you check this too?

Since this is such a trivial change, it would be unfortunate if this didn't make it for the next release I think.

chrisduerr added a commit to chrisduerr/winit that referenced this pull request Mar 7, 2020
There are two PRs I'm aware of that should be relatively trivial to get
merged, which would fix some issues. Other than those, I don't think it
makes sense to wait on anything.

 - Fix Windows crash: rust-windowing#1459
 - Fix macOS mouse reports: rust-windowing#1490

While rust-windowing#1459 seems pretty essential to actually make winit run, rust-windowing#1490 is
much less important and can probably be ignored if there aren't any
resources to merge it.
@ryanisaacg
Copy link
Contributor

I'm not on the affected version of Windows, I think? I can run it and see if it works on my system though.

@Osspial
Copy link
Contributor

Osspial commented Mar 7, 2020

@LaylConway mentioned that she was running into these panics in the Rust Discord, and this branch fixed the issues for her. I'll go ahead and merge this now. Sorry this was sitting on the backburner for so long!

@Osspial Osspial merged commit cbb60d2 into rust-windowing:master Mar 7, 2020
@chrisduerr chrisduerr deleted the fix-windows-assert branch March 7, 2020 19:33
Osspial pushed a commit that referenced this pull request Mar 9, 2020
There are two PRs I'm aware of that should be relatively trivial to get
merged, which would fix some issues. Other than those, I don't think it
makes sense to wait on anything.

 - Fix Windows crash: #1459
 - Fix macOS mouse reports: #1490

While #1459 seems pretty essential to actually make winit run, #1490 is
much less important and can probably be ignored if there aren't any
resources to merge it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C - waiting on maintainer A maintainer must review this code DS - windows
5 participants