-
Notifications
You must be signed in to change notification settings - Fork 497
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
全局消息弹窗 #1022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
一个线程内不能创建多个 XAML Islands 窗口
This reverts commit ea207e5.
现在 GDI 和 DwmSharedSurface 将检查窗口是否有重定向表面(即没有 WS_EX_NOREDIRECTIONBITMAP 样式),它们无法捕获这样的窗口。过去的行为是黑屏,现在将拒绝缩放并弹出错误消息。 即使添加了这个检查,也不代表成功的时候一定能捕获到窗口内容。
|
设置所有者窗口可能会失败,权限更高的窗口和 UWP 窗口会出现这种情况。目前的解决方案是定期置顶消息窗口,对于消息展示足够了,但实现窗口化缩放应找到更好的方案。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
类似于开启开发者模式的消息框,但可以显示在其他窗口上。为了做到这一点,我创建了一个新的 XAML Islands 窗口,它的尺寸为零,每次要显示消息时将它移到对应位置,这个方案可以完美处理 DPI 缩放问题。在一个线程中创建多个 XAML Islands 窗口理论上可行,但据说存在大量的 bug,因此这个新窗口必须创建在独立的线程中。
现在消息框只用于显示错误消息,这可以极大降低使用门槛,免得小白总是开重复的 issue。错误分为三类,一是缩放的先决条件错误,比如没有正确配置缩放模式、没有权限等,二是初始化缩放产生的错误,比如捕获失败和 CreateFence 失败(#979)等,三是缩放中途产生的错误,目前只有捕获中途出错。