MouseLeave event not firing when mouse leaves plugin container in Mac Firefox


  • For Silverlight apps which are running inside of Firefox on Mac, the MouseLeave event does not fire when you mouse off the Silverlight container. It still fires normally inside the Silverlight container. Mac Safari/Chrome, Windows Firefox/IE/Chrome all fire this event normally.

    I'm using the latest version of Firefox (10.0.2) and Silverlight (5.0.61118.0); on Mac OS X 10.6.8.

    To reproduce this error, create a basic Silverlight web project and set up some MouseEnter and MouseLeave events.  


    <UserControl x:Class="MacFFSLMouseout.MainPage"
        d:DesignHeight="300" d:DesignWidth="400">
        <Grid x:Name="LayoutRoot" Background="Blue" MouseEnter="MainPage_MouseEnter" MouseLeave="MainPage_MouseLeave">
            <TextBlock x:Name="text"  Foreground="White" Text="Default"></TextBlock>


    namespace MacFFSLMouseout
        public partial class MainPage : UserControl
            public MainPage()
            void MainPage_MouseEnter(object sender, MouseEventArgs e)
                this.text.Text = "Mouse entered";
            void MainPage_MouseLeave(object sender, MouseEventArgs e)
                this.text.Text = "Mouse left";

    CSS on host page is the default, recommended CSS:

     html, body {
    	    height: 100%;
    	    overflow: auto;
        body {
    	    padding: 0;
    	    margin: 0;
        #silverlightControlHost {
    	    height: 100%;

    Is my Firefox merely behaving strangely? Any suggestions for workarounds? I think my next step will be adding a JavaScript mouseoff event handler and calling a script method in Silverlight, but I'd rather not because it involves some icky workarounds in my Silverlight app.

    EDIT: I added a MouseMove handler:

    this.MouseMove += (s, e) => 
        this.text.Text = String.Format("Mouse moved to: ({0}, {1})", 
            e.GetPosition(this).X, e.GetPosition(this).Y);

    On my Mac Firefox, it's reporting that the mouse is at (5, 5) (edit 2: most of the time) when I move it off the plugin container. The browsers which are working all report (0, 0).  Here's a demo test page.

    Wednesday, February 29, 2012 9:34 AM

All replies