我无法通过 VNC 看到 WPF Windows 应用程序的上下文菜单 [英] i can't see a context menu of WPF windows app through VNC

查看:26
本文介绍了我无法通过 VNC 看到 WPF Windows 应用程序的上下文菜单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以打开上下文菜单,但无法通过 VNC 看到打开的菜单列表.(我知道我可以通过直接检查vnc服务器机器来打开上下文菜单)我在不同的 vnc 服务器/客户端机器(虽然都是 Windows Vista)和不同的 wpf 应用程序上进行了测试,但仍然看不到任何菜单列表.

I can open a context menu but cannot see the opened menu list through VNC. (I know that i can open the context menu by checking the vnc server machine directly) I tested on different vnc servers / clients machines (although all of them are windows Vista), and different wpf app, but still I cant see any menu list.

这是报告的问题吗?我找到了一些有关 windows 桌面 wpf 问题的信息,但我不知道 vnc.

Is this a reported problem? I found some information about wpf problem relating to windows desktop, but i dont know about vnc.

添加:我在 vnc 环境下的 windows 本机应用程序或 windows 窗体应用程序上没有这个问题.

ADDED : I dont have this problem on windows native apps or windows forms apps under my vnc environment.

推荐答案

我没有阅读/发现任何有关通过远程连接查看 WPF 应用程序的已知问题.但是,如果您考虑如何远程连接工作,我想对问题进行一些猜测,甚至可能是一个解决方案.

I have not read/found any known issue regarding viewing WPF applications across a remote connection. However if you think about how remote connections work I would like hazard a few guesses to the problem and even maybe a solution.

当您安装任何远程桌面软件时,您实际上会做两件事:设置中继器以中继输入命令和添加充当帧服务器的显示适配器,即,而不是输出内容屏幕到监视器它通过网络发送信息.

When you install any remote desktop software you really doing two things: setting up a repeater to relay input commands and adding a display adapter that acts as a frame server, i.e., instead of outputting the contents of the screen to a monitor it sends the information over the network.

如您所知,WPF 使用 DirectX 来加速其渲染(受 GPU 限制),但遗憾的是,所有显卡加速都无法通过远程桌面连接工作.

As you know, WPF utilises DirectX to accelerate its rendering (GPU bound) and it is an unfortunate limitation that all graphic card acceleration does not work via remote desktop connection.

我认为在您的特定情况下发生的事情是,WPF 在尝试绘制上下文菜单时不会退回到使用它的软件渲染管道 - 可能是因为上下文菜单是一个 Popup 和在单独的可视化树中.

What I believe is happening in your specific case is that WPF is not falling back to using it's software rendering pipeline when it attempts to draw the context menu - perhaps because the context menu is a Popup and in a separate visual tree.

值得尝试的是强制您的 WPF 应用程序使用软件渲染.

Something worth trying would be to force your WPF application to use software rendering.

void OnLoaded(object sender, EventArgs e)
{
    HwndSource hwndSource = (HwndSource)PresentationSource.FromVisual(this);
    HwndTarget hwndTarget = hwndSource.CompositionTarget;

    hwndTarget.RenderMode = RenderMode.SoftwareOnly;
}

如果确实如此,您有两种选择:强制 WPF 使用软件渲染管道或尝试部署 高性能远程桌面访问软件来自惠普的解决方案.

If this does prove to be the case, you have two options: force WPF to use software rendering pipeline or try deploying a high-performance remote desktop access software solution from Hewlett Packard.

HTH,

参考资料
- 微软关于解决 WPF 中图形问题的指南.
- 硬件WPF 中的加速
- 惠普远程图形软件

更新:对于搜索并找到此答案的其他人,您需要更改 VNC 客户端设置以启用 alpha 混合.正如@mcdrewski 所指出的,默认情况下 VNC 不会检测/渲染 alpha 混合窗口.启用 alpha 混合会产生成本,您会注意到 VNC 客户端有点滞后.

Update: For others searching and finding this answer, you need change a VNC client setting to enable alpha blending. As noted by @mcdrewski that by default VNC won't detect/render alpha blended windows. Enabling alpha blending incurs a cost and you will notice the VNC client lag a bit.

这篇关于我无法通过 VNC 看到 WPF Windows 应用程序的上下文菜单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆