nwjs / nw.js

Call all Node.js modules directly from DOM/WebWorker and enable a new way of writing applications with all Web technologies.
https://nwjs.io
MIT License
40.33k stars 3.88k forks source link

Custom cursor CSS not preserved in window #2250

Open AshleyScirra opened 10 years ago

AshleyScirra commented 10 years ago

Demo: https://dl.dropboxusercontent.com/u/15217362/nwcursor.zip

Setting a custom CSS cursor using the "cursor" style (in this case set to a data URI) does not preserve the cursor on Windows 8.1.

Steps to reproduce:

  1. Launch the demo. Notice the yellow cursor.
  2. Move the mouse outside the window, and back in again.
  3. Try moving the mouse outside and in again at different speeds.

Observed result:

The mouse cursor inside the node-webkit window seems to be randomly chosen between normal Windows cursor, a window border resize cursor, or the yellow custom cursor.

Expected result:

The yellow custom cursor should always display when the mouse is inside the node-webkit window.

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

morgondag commented 9 years ago

Can confirm the steps above. Having a nw.js window open then opening another application, and then refocus the nw.js window the cursor defaults to window-resize cursor. All types of CSS cursors are overwritten by the resize-cursor.

egaliano commented 8 years ago

it's a huge block to use nw.js in kiosk apps =/ are you planning to solve this soon ?

nwjs-bot commented 8 years ago

This should be working with latest version now.

In 0.13 we changed to an optimized architecture so more features can be supported, see http://nwjs.io/blog/whats-new-in-0.13/ and it's good for keeping up with Chromium upstream -- we released with Node.js v6.0 and new Chromium versions within 1 day after upstream release.

The new version would fixed many issues reported here and we're scrubbing them. This issue is closed as we believe it should be fixed. Please leave a message if it isn't and we'll reopen it.

Fib100 commented 6 years ago

@AshleyScirra This issue is still occurring for me on Windows 10 using nwjs v0.30. If my mouse cursor leaves the nwjs window, the custom cursor gets replaced with a standard Windows cursor.

Here is a minimal app that shows the issue (built using nwjs v0.30): minimal example app

Here's the C3 project file as well: C3 project

Fib100 commented 6 years ago

@rogerwang @AshleyScirra Can we please re-open this issue. It may have been fixed in the past, but it seems to me that it has resurfaced.

Fib100 commented 6 years ago

@rogerwang @AshleyScirra @morgondag has anyone confirmed that this bug has re-surfaced? Please see my "minimal example app" from my above comment. It was built using nwjs v0.30.

I have a game published on Steam and when in windowed mode, the cursor gets all messed up. It makes it look amateurish.

rogerwang commented 6 years ago

@Christywl please try to reproduce. thanks.

Christywl commented 6 years ago

I can reproduce this issue with @Fib100's sample: The mouse cursor is randomly changed between a normal Windows cursor, a window border resize cursor, or the custom cursor.

AshleyScirra commented 6 years ago

We still get reports of this, e.g.: https://www.construct.net/forum/construct-2/closed-bugs-22/cursor-image-disappears-135883

This report is nearly 4 years old now. Is it possible this could be fixed?

rogerwang commented 6 years ago

could it be reproduced with a Chrome App in Chrome browser?

TheRealDannyyy commented 6 years ago

@rogerwang Could also reproduce this using NWjs v0.29.0 by simply moving the cursor outside the window and back inside. (The person who reported it in the forum reproduced it using NWjs v0.31.0.)

Here is the requested Chromeapp: Cursor Bug (Chromeapp) I could not reproduce this issue using the Chromeapp and Chrome M67.

TheRealDannyyy commented 6 years ago

Can't reproduce this issue using NW.js v0.32.0 and this example project anymore. (OS: Windows 7 SP1; Unzip example project before use.)

@AshleyScirra Can you confirm this as well?

Fib100 commented 6 years ago

I just re-built my game using NW.js v0.32.0 and I confirm the issue is fixed as far as I can tell.

Thanks!

trapless commented 4 years ago

This works for me using NW.js v0.29.0

window.onMouseLeave = () => {
  document.body.style.cursor = 'none';
};
window.onMouseEnter = () => {
  document.body.style.cursor = 'url("exmpl/dir/mycursor.png"), default';
};

document.addEventListener('mouseleave', onMouseLeave);
document.addEventListener('mouseenter', onMouseEnter);