I have a fairly large application that uses WPF for its user interface. I recently found an unusual defect regarding 3D screensavers. The 3D screensavers 3D FlowerBox,3D Flying Objects,3D Pipes,3D Text causes 1 of my WPF windows to disappear when the screensaver activates. Other screensavers are fine.
My application only encounters this problem on Windows XP.
I have some experience with DirectX. When a 3D screensavers activates, the d3d device context will be switched to exclusive mode. I reckon that WPF has trouble restoring the device context when the device switches back to cooperative mode (hence why its only affecting windows XP)
Has anyone seen such a scenario occur before ? Is there a remedy for the problem ?
Windows XP SP3, DirectX 9.0c, .NET 3.5
Not that exact one, but I have definitely seen strange problems with WPF and Windows XP, especially. The easy thing to say would be that you should try to move to Windows 7 ASAP, but then I would just be a jerk.
First off, check your video device driver. We've had a lot of problems with WPF on XP when an old graphics cards' device drivers are used. Update it to the latest version. That could take care of it.
If that doesn't work, and if you can, try swapping the video card for a different brand. That, too may work (though highly undesirable).
Third -- is your window semi-transparent or non-rectangular? If you switch your WPF app to be a regular, rectangular, boring, ugly Windows XP window, we've found that a lot of these quirks went away when we stopped getting fancy with our main windows. My guess is that it has something to do with the fact that XP has no desktop window manager. But then again I don't really know.
I know this is all very unsatisfying. We've had stuff like this happen to us on XP. I'm praying for our IT department to be able to move us to 7 this year...
Related
After updating windows to version 1803 none of the WPF applications on a laptop (Intel hd 500 GPU) work properly anymore (start with a blank window or don't show the GUI at all). I've made a simple test app that only shows one button and it results in an empty window. If I turn off the hardware rendering (according to Software rendering mode - WPF), the application works as expected.
I've tried several versions of the GPU driver including the generic MS one, latest one, latest one recommended by the laptop manufacturer, older ones but all with the same result. The recovery point to the previous version is not available anymore.
The laptop is barely running existing applications so setting the registry not to use the hardware rendering for all the .net applications is not an option due to performance degradation.
Has anyone experienced anything similar, are any other solutions to solving this?
Thanks,
Tomislav
The issue happens because I'm using the laptop with the lid down (I connect remotely to it). This seems to put the GPU to sleep/power down state which messes up the applications that use GPU acceleration. Interestingly desktop and some applications run normally.
Adding a fake display solved the issue (https://forums.lenovo.com/t5/ThinkPad-X-Series-Laptops/Working-with-closed-lid/td-p/1623610, https://superuser.com/questions/1271344/fake-montitor-for-teamviewer-on-laptop-with-closed-lid).
I have also had this issue and have found that if you uninstall and delete the Intel Display Adapter, then let Windows automatically find the default, this issue is resolved.
I am building a WPF Application that is going to be used on Desktop as well as on a Surface Pro Tablet running the Win10 Creators Update.
If a Textbox gets Focus the onscreenkeyboard of Win10 should open on the bottom of the screen and move the application up the screen to push the focused element back into view.
I have implemented WpfTabTib which worked pretty well until we updated the tablet to the creators version. Technically it is still working but with an ugly animation moving the window up, down and up again to open the keyboard.
Having read that microsoft adjusted the behaviour of the keyboard to match the uwp behaviour I have updated my .Net framework to 4.6.2 without the hoped result. It seems Microsoft doesn't care for this behaviour.
Does anyone have the same problem or an different approach for me ?
Thanks a lot!
Edit: Updating the Tablet to an Insider Preview of the coming Windows Fall Update changed the behaviour again: The opening animation is now a little better, but still far from nice. And as new problem closing the osk doesn't move the application back down.
We have a huge project in WPF .NET 4.0 which should support Windows XP SP3 and above. (hence the use of .NET 4.0) It has no problems whatsoever on Windows 7 and 8/8.1. However we're experiencing major visual issues when running on Windows XP to the point that the application is unusable.
I searched a lot and came across some similar questions such as this one but none of the suggested solutions worked for us.
Here's an screen shot taken on Windows XP SP3:
The odd thing here is that there is clone of "28" TextBlock you see in the screen shot, to the left of it. They have everything in common except their name but the left one is not rendered properly!
And here is how it really looks like (taken on a Windows 8.1 test machine):
Some pages are even worse:
When I remove AllowsTransparency from the main window, it looks like this on XP: (Note that the title bar has no problems any more)
We're really stuck and have no clues about its cause. Any help would be appreciated.
It seems this problem is related to the graphic card. In another VM with a different graphics accelerator we didn't face any major problems. In the problematic test machine, we lowered hardware acceleration to the third level and the problem is gone.
Display Properties -> Settings -> Advanced -> Troubleshoot
Although there are still some small issues with some mouse over animations and we lost the benefits cursor accelerations bring to the table, it's acceptable for us since not much is expected from Windows XP.
I've written a WPF application (in Visual C# 2010 Express) that has 2 windows. The 1st has a various buttons, the other displays video using the MediaElement control. When a button is pressed, a video associated with it is played or stopped if it's already playing.
On my development machine (Windows 7, good graphics card, lots of memory etc), this runs fine. The only problem I've encountered is that when attached to the debugger it is very unstable but when run normally these issues go away.
Unfortunately when run on a much less powerful XP machine the videos run at 1-2fps. This is despite the fact that the videos run fine in Windows Media Player.
There seem to quite a lot of reports of poor performance for the MediaElement control (not to mention inconsistencies in what it can play) so I decided to look at some alternatives.
I tried a free library call WPF MediaKit (http://wpfmediakit.codeplex.com) that I thought might have some effect, however while I've got it to work on an XP machine, it resolutely refuses to display videos on my development machine despite using exactly the same code. I'm still hoping I can this to work but I'm not confident it will help given it's still using the MediaElement control behind the scenes.
I then tried using wmp.dll COM control (Windows forms rather than WPF) and even with the simplest app (new Windows Form project, WMP control added to form, and 1 line of code to set the URL on load) I get odd behaviour. With the debugger attached, it works across multiple monitors, but sometimes when it starts playing, it just repeatedly stutters over the 1st few frames and the only way to break it out of this seems to be to move it to the other monitor. If I'm not using the debugger, I don't seem to get the stutter issue but the video is only displayed on the main monitor, as soon as I move the window to the secondary monitor, it goes black.
So my question is has anyone experienced anything like the above and/or have a decent solution to it? It would be especially nice to find something that works consistently with and without the debugger attached!
Have you tried this library?
http://directshownet.sourceforge.net/about.html
There's also this .NET interface to VideoLAN media player, but that introduces a dependency to VLC:
http://wiki.videolan.org/.Net_Interface_to_VLC
WPF MediaKit does not use MediaElement behind the scenes, but instead uses the D3DImage interop class to provide high performance video to WPF.
WPF in XP has always been a hit-or-miss in terms of performance. You might want to take a look at the rendering tier to ensure WPF is fully hardware accelerating. Also make sure you have the newest video drivers available and that the GPU is capable.
-Jer
I have heard that WPF primitives will not be supported by remote desktop on windows XP. The implication of this is that if you run a WPF application on a vista machine and display it on an XP machine (via remote desktop) the display will be sent as a compressed bitmap.
This issue is resolved in Vista-Vista comunication via DirectX 11 (?) but this will not be made available on XP. There is obviously a performance hit here, I would like to understand it before making any inroads into developing applications to WPF.
Some information on this topic can be found here:
http://blogs.msdn.com/tims/archive/2007/01/05/comparing-wpf-on-windows-vista-v-windows-xp.aspx
See comment from the above link (quote):
To SpongeJim's question, this is done by the MIL (media integration layer), which is the underlying core of WPF that handles composition. On a Vista/Vista remote desktop connection, the MIL primitives are remoted and then reconstituted. On other combinations (e.g. 2003/XP), what gets remoted is bitmaps, which is obviously far more bandwidth-intensive. More depth on this topic can be found on Greg Schechter's blog, and in this entry in particular: http://blogs.msdn.com/greg_schechter/archive/2006/06/09/623566.aspx
Does anyone have any experience or more up to date information on this issue?
As of .NET 3.5 SP1, all WPF graphics are remoted as bitmaps, even on Vista-to-Vista communication. From http://blogs.msdn.com/jgoldb/archive/2008/05/15/what-s-new-for-performance-in-wpf-in-net-3-5-sp1.aspx:
We now remote as bitmaps in ALL cases.
The reason is that WPF 3.5 SP1 now
uses a new graphics DLL (wpfgfx.dll)
and certain changes could not be made
to Vista’s existing graphics DLL
(milcore.dll) that is also used by
DWM.
As other commenters have noted, the performance will greatly depend on the design of your application’s UI. The potential upshot is that you only have to test in one scenario; remoting performance should now be the same regardless of the client or server.
We have had no problems using both Remote Admin and Bomgar for remoting once those apps were updated to work with WPF. We've tested XP to XP, XP to Vista, Vista to XP, and Vista to Vista. We'd initially only had problems with tooltips and combo-box drop downs/popups. For the last six months or so, things have been fine.
I just tested remoting into a Vista VM from my XP desktop and our app looked great (if running a bit slow, but it is a VM...) I switched to low quality 8-bit color and the performance problems almost completely went away. The gradiation, etc, was lost on our window background, etc, but it was definitely still usable.
I don't think you should have any functional problems, and only minor performance issues.
i guess this depends on your wpf app.
if you have lots of gradients, animations, brushes, etc...your app will definitely run slower over the wire...