When I create a windowless Silverlight app and run it on Firefox, wrong mouse positions are reported. There is a vertical offset between the actual mouse position and what the application responds to.
I also tagged this question with Flash because my research shows that this problem also occurs with Flash (see links below).
To reproduce:
Step 1: Create a new Silverlight application.
Step 2: Inside the grid of MainApp.xaml add the following:
<HyperlinkButton NavigateUri="http://google.com" VerticalAlignment="Center" HorizontalAlignment="Center">GOOGLE</HyperlinkButton>
Step 3: In SilverApplicationXTestPage.aspx (in the web project) add the following parameter to the Silverlight object:
<param name="windowless" value="true" />
Now run the silverlight application. When you hover the link it doesn't get underlined. Now slowly move the mouse up until at a certain offset above the link it will get highlighted.
This problem doesn't happen if you do one of the following:
Switch Firefox into full screen mode (it seems that the top bar is the cause for the offset, so when it's not visible there is no offset).
Do not use Silverlight in a windowless mode.
Use any other browser.
I'm using Silverlight 4 on Firefox 8.0 on Windows 7.
This seems like an old problem that affects not just Silverlight, but also Flash.
In my research I came across the following suggested workarounds, non of which worked for me:
Do not use overflow in css.
Use css to set html margin of 1px.
Do not use iframe (but the reproduction steps above do not use an iframe anyway).
As I mentioned none of the above workarounds seem to work.
Here are some references to mentions of this problem or similar:
http://forums.silverlight.net/t/161640.aspx/1/10
https://bugzilla.mozilla.org/show_bug.cgi?id=362193
http://forums.silverlight.net/t/94583.aspx/2/10#
https://bugzilla.mozilla.org/show_bug.cgi?id=536429
Does anyone know how to overcome this? Any workaround? I'm desperate!
I found this: http://support.mozilla.org/en-US/questions/795168.
"Enabling the plugin-container.exe in about:config (dom.ipc.plugins.enabled) fixes the mouse issue but then Silverlight plugin pop-ups (webcam/microphone permission for example) freeze the browser."
I didn't see the problem with the popup (a copy permissions) after changing the config.
Making it full-screen also helped before I made this config change.
This requires the user to change their browser setting, which is not ideal.
This is similar to this question: Silverlight- bad mouse position when embedded in html page when Firefox has zoom
Related
Running the CefSharp/WinForms/MinimalExample on Win 10 machine with display setting set to 125% causes a weird distortion in the website as I hover my mouse over the DOM element.
Here is how it looks,
As you can see, as I hover over the address text box, the text box jumps. I tried to then switch to html5test.com and it still has the same issue.
This only occurs when the display setting is set to anything other than 100%. Is this a bug, or I need to change something?
Ok, so it is really simple. It has nothing to do with CefSharp but you need to make your WinForm DPIAware and the easiest way to do that is,
Right-Click on your project and select Add -> New Item
Select Application Manifest File
If you are using VS 2015, search for dpiaware term. Uncomment the code and rebuild and you are set.
In case, you don't have VS 2015, copy this code,
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
</windowsSettings>
</application>
and paste it inside the <assembly> tag. Save and rebuild and your WinForm is DPI Aware.
In a standard WPF app, I have a WebBrowser control which has been navigated to a HTML5 sample page (http://ie.microsoft.com/testdrive/Browser/BrowserSurface/).
In the browser outside the app, I can interact with this site as expected – move photo’s around, use gestures etc.
In the WebBrowser control the site does not work as expected. It renders, but it does not respond to any touch gestures – It will, however, zoom in and out when I pinch.
Is it possible to make the WebBrowser control pass gesture events etc so that I can interact with the site as I would in a normal browser?
Many thanks for any help with this!
Kris
I know this is an old question but I think this has something to do with the fact that the WebBrowserControl standard uses IE7 ActiveX. I had the same problem which always gave me JavaScript errors in the control for TouchEvents.
After I added some registery key to force the WebBrowserControl to use the latest IE version installed it worked.
Here is what I've add to my registery. Paste it in a txt file and save it as an .reg file. Then DoubleClick it. Or enter the key/value manual in your registery via Regedit.
I even included this in my application code to add the key/value automaticially if it doesn't exist yet.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION]
"RetailTestApplication.exe"=dword:270f
Sorry, the code plugin srews up.
Change IE version for the WPF WebBrowserControl
MSDN Internet Feature Controls (B..C)
I am building a mobile application using Flash Builder. I am testing on a Motorola Xoom. When the app opens on the attached Xoom it opens with the correct orientation (landscape), but when it opens on the computer in the emulator it is backwards (Portrait).
I have specified the ratio and orientation in the *-app.xml:
<aspectRatio>landscape</aspectRatio>
<autoOrients>false</autoOrients>
I'm assuming it is a bug but it is possible that I am missing something or that there may be a fix.
In my case, neither was working. So, for the desktop version, I've made an ugly thing: duplicated the aspectRatio property above the others, after title property. I don't know if the position of the property matters, but that way it worked.
There is just one problem with this approach: when building the debug version of your application all works fine (including in mobile), but when you build the release version, an error occurs saying that the aspectRation property is unexpected. Just remove one of them and the build will work.
Just for the register, to make it work in mobile, I had to set the property aspectRatio in the code too, like this:
stage.setAspectRatio(StageAspectRatio.LANDSCAPE);
We have a Silverlight control embedded in an html page. When I zoom the html page in FireFox 3.5 (ctrl - +) and then try to click on something in the Silverlight control the mouse input is not taken at the correct place.
I have to click above the control to get it. This behavior can be seen here:
http://silverlight.codeplex.com/
Any idea how to fix this?
There are numerous reports of the issue and some possible fixes.
See these links:
http://forums.silverlight.net/p/227806/614938.aspx
"I decided to try uninstalling and reinstalling firefox and that did the trick."
https://support.mozilla.org/en-US/questions/795168
"Enabling the plugin-container.exe in about:config (dom.ipc.plugins.enabled) fixes the mouse issue but then Silverlight plugin pop-ups (webcam/microphone permission for example) freeze the browser."
Windowless Silverlight (and Flash?) app on Firefox: wrong mouse positions reported
"This problem doesn't happen if you do one of the following:
Switch Firefox into full screen mode (it seems that the top bar is the cause for the offset, so when it's not visible there is no offset).
Do not use Silverlight in a windowless mode.
Use any other browser.
...
In my research I came across the following suggested workarounds...:
Do not use overflow in css.
Use css to set html margin of 1px.
Do not use iframe"
I'm having problems with the rendering of a WPF app over a remote desktop connection.
The applications chrome is rendering, but none of the content is coming through, as if the window is not drawing. Instead the previous content of the screen is showing in it's place.
This has been a problem with the application running on both Vista & Win 7, with remote control being taken from XP and Win7.
The problem is not application specific, if I create a new WPF app, with just a textblock on the window, it will also not run. (Neather will the windows preview in VS2008 display.)
Is there some trick to getting WPF running under RDP?
I read on Kevin Dente's blog (from a twitter post) that he was having trouble with WPF apps in virtual machines. While not the same as Remote Desktop, it's possible the problem could be the same. Kevin was able to fix his problem by disabling hardware accelleration by creating a DWORD registry value at
HKEY_CURRENT_USER\SOFTWARE\Microsoft\Avalon.Graphics\DisableHWAcceleration
and then setting it to 1.
His original blog post is here: http://weblogs.asp.net/kdente/archive/2009/10/19/visual-studio-2010-beta-2-editor-performance-fix-running-on-a-virtual-machine.aspx
That may not be your exact solution, but maybe it points you in the right direction.
WPF should render over RDP; it's smart enough to know when it can render in hardware, and when it can't it reverts to its own GDI+ based software rendering. I would make sure you're running .NET Framework 3.5 SP1 on the remote machine, since there were changes to remoting that might pose issues. (See link below.)
I've been developing a WPF app for the past 6 months and it works just fine over RDP. (From Vista and Win7 to XP, Vista and Server 2003.) One important caveat, however, is that it renders using the Classic theme. So if you're using controls that don't have a classic theme, they won't render. If you're just dropping a TextBox on a Window, then obviously that's not your problem.
Check out this question for some links that may be helpful: Are there problems with rendering WPF over Remote Desktop under Windows XP?
I just had this problem with the ribbonwindow not displaying correctly when testing for the first time via RDP - the transparent background was white, the close minimize/maximize buttons were missing, the rounded corners on the bottom of the window were square, and the top row of ribbon buttons were almost impossible to select.
Turns out there was a simple fix for me. Right-click the RDP connection icon (I have it saved on my desktop), select "Edit", then the "experience" tab, and change "detect connection quality automatically" to "LAN (10 Mbps or higher)".
This fixed it for me.
Ade
Did you also try Win7 latest RDP - Win7 connection? The thing is WPF doesn't use GDI to draw elements.
VNC clients (like UltraVNC) probably will do the trick for you as they using much simplier algorithms more like of sending bitmaps.
I have the same problem than the asker. The standard, out-of-the-box Checkbox is not rendering correctly. I can only see if it is checked when hoovering the checkbox. Otherwhise, no difference between checked and unchecked. Important note : It occurs when setting the foreground to white (see here : https://social.msdn.microsoft.com/Forums/vstudio/en-US/1c03db49-7e53-4cbb-9dd1-b328017c4453/wpf-checkbox-and-radiobutton-check-mark-not-showing-under-xp-windows-classic-theme-and-remote?forum=wpf)
Our application used to have this problem with a custom progress bar.
We fixed this by setting the background color of the Border control to White. This leads me to think there is an issue with transparent backgrounds
There is no special trick needed to get WPF content to show across remote desktop. Our WPF-based app renders just fine over RDP (tried from numerous machines) with no problems. We're even using animations, gradients, WriteableBitmap, etc. w/ no problems.