首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >win10 17025 触摸bug

win10 17025 触摸bug

作者头像
林德熙
发布2018-09-19 12:33:45
7210
发布2018-09-19 12:33:45
举报

This article is written in both English and Chinese. 本文使用中文英文两个版本。 在 win10 的 17025(直到 17134 也就是正式版 1803 也没有修复) 可以容易让 UWP 触摸失效。做法是创建一个窗口背景是透明的 wpf 程序,把他置顶,这时所有 uwp 程序就无法触摸。在正式版 17134 是所有的触摸程序都触摸失效,除了可以把触摸转鼠标的程序如 VisualStudio 和 QQ 还能使用,如 Edge 和 Chrome 都无法使用。 I found the easy way to make the UWP app touch not work in win10 17025(until 17134). To create a wpf app with transparent background and make it Topmost, you can see all of the UWP app’s touch not work.

中文

写英文的原因是给微软报这个问题,现在发在 微软反馈 希望大家投票。

步骤:

  1. 创建一个 wpf 程序
  2. 设置 wpf 的窗口最大化
  3. 设置 wpf 程序的背景为透明
  4. 启动 wpf 程序

这时就可以看到 Edge 等软件都无法触摸

在检查的时候可以使用ManipulationDemo,可以看到在触摸的时候没有 Pointer 消息。

下面是关闭 wpf 程序之后,可以看到最下面有 Pointer 消息

下面是这个wpf软件代码:

        public MainWindow()
        {
            InitializeComponent();

            AllowsTransparency = true;
            WindowStyle = WindowStyle.None;
            WindowState = WindowState.Maximized;
            Background = Brushes.Transparent;
            Topmost = true;
        }

解决方案

最新的微软补丁August 30, 2018—KB4346783 修复了这个问题,只需要在用户的设备安装这个补丁就可以解决

下面是不使用补丁的方法

如果设置了一个窗口满足下面的属性

            WindowStyle = WindowStyle.None;
            WindowState = WindowState.Maximized;

            WindowStyle="None" 
            AllowsTransparency="True"

那么就必须要设置 ResizeMode="NoResize" 不然就会出现下面的问题

  • 在 win10 17025-17134 版本,如果同时设置AllowsTransparency = true;窗口下面所有程序触摸失效
  • 还原窗口再最大化,窗口出现偏移
  • 切换屏幕,窗口出现偏移

English

Step:

  1. Create a wpf app
  2. Set the wpf app’s windows state is Maximized
  3. Set the wpf app’s windows background is transparent
  4. Run the wpf app

Then you can see all of the uwp app’s such as edge and setting touch not work.

You can use ManipulationDemo to help you see the Pointer message that cant get when touch. I use ManipulationDemo to find the pointer message have not be received. The app can only receive the mouse message.

I took an image that shows the pointer message when I closed the wpf app.

This is the wpf app’s code:

        public MainWindow()
        {
            InitializeComponent();

            AllowsTransparency = true;
            WindowStyle = WindowStyle.None;
            WindowState = WindowState.Maximized;
            Background = Brushes.Transparent;
            Topmost = true;
        }

This is my system and I think in win10 17025 the windows cant make the app uses pointer message to work that exists another transparent background app in above.

Solution

Microsoft has fixed this issue in .NET Framework August 2018 Preview of Quality Rollup.

Addresses an issue where touch and mouse events were handled differently in Windows Presentation Foundation (WPF) applications that have a transparent overlay window.


If you have a Window that set the following properties.

            WindowStyle = WindowStyle.None;
            WindowState = WindowState.Maximized;

Or

            WindowStyle="None" 
            AllowsTransparency="True"

You must set ResizeMode="NoResize" to avoid some problems as

  • All applications lost touch or stylus if a WPF transparent window covers on them.
  • Windows appears offset when set it to Maximized from Normal.
  • Windows appears offset when switch screen.

See c# - On Windows 10 (1803), all applications lost touch or stylus if a WPF transparent window covers on them

On Windows 10 (1803), all applications lost touch or stylus if a WPF transparent window covers on them - Developer Community

dotnet-campus/TouchIssueOnWindows10.0.17134: On Windows 10 (1803), all applications lost touch or stylus if a WPF transparent window covers on them


本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 中文
    • 解决方案
    • English
      • Solution
      领券
      问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档