English 中文(简体)
i can t see a context menu of WPF windows app through VNC
原标题:
  • 时间:2010-06-07 14:03:45
  •  标签:
  • wpf
  • vnc

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.

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

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

最佳回答

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.

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.

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.

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;
}

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,

References
- Microsoft guidelines for troubleshooting graphic issues in WPF.
- Hardware Acceleration in WPF
- HP Remote Graphics Software


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.

问题回答

The solution is: check the "Capture alpha blending" option in VNC Server s admin properties -- henon

The only way I have been able to make Alpha blended windows or menus show up in VNC is to turn off the "Blank the screen while VNC viewers are connected" option under Desktop in the VNCconfig app for the server.

Is it just happening on WPF applications or any other apps? Try to change the desktop color quality to 16 bit.

In the VNC server option look for the option named UseCaptureBlt and mark it TRUE





相关问题
WPF convert 2d mouse click into 3d space

I have several geometry meshes in my Viewport3D, these have bounds of (w:1800, h:500, d:25). When a user clicks in the middle of the mesh, I want the Point3D of (900, 500, 25)... How can I achieve ...

Editing a xaml icons or images

Is it possible to edit a xaml icons or images in the expression design or using other tools? Is it possible to import a xaml images (that e.g you have exported) in the expression designer for editing?...

WPF: writing smoke tests using ViewModels

I am considering to write smoke tests for our WPF application. The question that I am faced is: should we use UI automation( or some other technology that creates a UI script), or is it good enough to ...

WPF - MVVM - NHibernate Validation

Im facing a bit of an issue when trying to validate a decimal property on domain object which is bound to a textbox on the view through the viewmodel. I am using NHibernate to decorate my property on ...

How do WPF Markup Extensions raise compile errors?

Certain markup extensions raise compile errors. For example StaticExtension (x:Static) raises a compile error if the referenced class cannot be found. Anyone know the mechanism for this? Is it baked ...

WPF design-time context menu

I am trying to create a custom wpf control, I m wondering how I can add some design-time features. I ve googled and can t seem to get to my goal. So here s my simple question, how can I add an entry ...

How to combine DataTrigger and EventTrigger?

NOTE I have asked the related question (with an accepted answer): How to combine DataTrigger and Trigger? I think I need to combine an EventTrigger and a DataTrigger to achieve what I m after: when ...

热门标签