Unity Web player issue - mouse hidden for all new windows

Discussion in 'Editor & General Support' started by shaun, Apr 12, 2007.

  1. shaun

    shaun

    Member

    Joined:
    Mar 23, 2007
    Messages:
    719
    I've come across a strange problem when viewing Unity Web players in Safari.
    When i open a new window over an active Unity Web player window, the mouse is hidden in that same region for the new window.
    The problem goes away when Safari is not in focus.

    Anyone else had this problem? - its a bit annoying when you're trying to browse other pages and cant find your mouse ;)

    Cheers
    Shaun
     
  2. BasketQase

    BasketQase

    New Member

    Joined:
    Sep 12, 2005
    Messages:
    97
    I've just encountered the same issue in the regular Unity player.

    It seems that if the unity player is (or is in) the active application and you have Screen.showCursor set to false, Unity will keep the cursor hidden even if the player is no longer the front window.

    There are several ways to reproduce this effect:

    If you use a custom cursor that tracks the position of the mouse but doesn't show the system cursor, you can open your (non-web) player in windowed mode hit the minimize button, but keep the app active. You'll find that in the screen region where you player was before minimizing the mouse will disappear.

    Again, with a custom cursor -- if you open the about box and it opens (or is placed) on top of the unity player, you will not see the system cursor when mousing over the about box...

    All this brings me to my question . . . is there a way to determine if the player is in fact the front/top-most window, and if not, be able to then parse that fact and change the cursor setting accordingly?

    -rob
     
  3. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Messages:
    6,186
    Known and logged bug, sorry about that. I'll add some fresh notes to the bug record in the hopes of bumping up the priority a notch or three.

    Perhaps you can use some browser JavaScript to detect when your current window is no longer active (use the window object's onblur event) and send a message to the Unity content to reveal the mouse. Of course you'd then need to again detect when focus is regained by the window to hide the cursor once more. Sorry about the workaround needs but hopefully it gets you guys working while waiting for us to implement a proper fix.
     
  4. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Messages:
    6,186
    I mentioned a web player workaround above but that's obviously not going to work in a stand-alone case. Honestly I'm just not sure if there are any solutions or workarounds in that case, I'll see if I can find any for you (stay tuned).


    Edit: and after inquiring internally there doesn't appear to be a way to do this detection in the stand-alone player. The bug is now on the high-priority list for a 2.x dot-release update.
     
  5. scchu

    scchu

    New Member

    Joined:
    Apr 8, 2011
    Messages:
    2
    Hi, I'm encountering the same issue with the latest Unity web player (3.x). Just curious if this issue has been resolved or if there's a way around it. I've tried to implement a window.blur detection method via Javascript and send the status to Unity to grab/release mouse cursor depending on window status. But it's still buggy in IE7 and IE8 (and apparently also some issues in Chrome).

    Please advise.
     
  6. scchu

    scchu

    New Member

    Joined:
    Apr 8, 2011
    Messages:
    2
    I've posted more technical details on StackOverflow just in case someone over there may have similar experience as well:
    http://stackoverflow.com/questions/5589741/javascript-unity-3d-custom-mouse-cursor-ie-woes

    Please help vote it up to help gain more visibility if you feel the issue is legitimate and would also like to see it resolved with an elegant solution. Or if any of you was able to successfully work around or resolve the issue, please do share.


    Solution found:
    http://forum.unity3d.com/threads/27...-different-tab?p=184304&viewfull=1#post184304

    And I also closed my own question on StackOverflow:
    http://stackoverflow.com/questions/...d-custom-mouse-cursor-ie-woes/5592373#5592373
     
    Last edited: Apr 8, 2011