Adobe-CEP / CEP-Resources

Tools and documentation for building Creative Cloud app extensions with CEP
https://www.adobe.io/apis/creativecloud/cep.html
1.62k stars 828 forks source link

CSS Cursor issues when windows scaling is not 100% #463

Open GoodBoyNinja opened 2 years ago

GoodBoyNinja commented 2 years ago

I noticed today that css cursor changes happen to not work properly. After some debugging I found that it has to do with Windows Display Scaling.

In this example, windows display scaling is set to 100%. The cursor properly changes on mouse down, and changes back on mouse up. ezgif com-gif-maker (1)

But when windows scaling is set to higher values (175%, 200% etc), the same code produces a different result. The cursor is no longer changing to the new state while mouse is down, and sometimes flashes the new state when mouse is up. ezgif com-gif-maker

The code is:

    document.addEventListener("mousedown", () => {
        document.documentElement.style.cursor = "crosshair";
    });

    document.addEventListener("mouseup", () => {
        document.documentElement.style.cursor = null;
    });

This also holds true to pure css cursor changes.

CEP version 10.0, AE 2022, MacBook Pro 2014 running windows.

GoodBoyNinja commented 2 years ago

Something else I have noticed is that when the cep panel is undocked, the behavior may change based on where the panel is located on the screen. Moving the panel around may cause the cursor change to break / work, depending on where it is.

ErinFinnegan commented 2 years ago

Hi there!

Thanks for the code and recordings, these are very useful!

Can you tell us which app this is happening in? (InDesign?) and which versions? Is this behavior consistent on two different apps (say, InDesign and Illustrator?) or across different versions of the same app (InDesign 16.4 and 17.2)? Bonus points if you can test on both macOS and Windows, but do let us know which platform you're on...

To see if it's a CEP bug or an app bug we need these kind of details... but just to reproduce the issue we'll need to know the app version and OS you're using.

GoodBoyNinja commented 2 years ago

Hey Erin! This happens to me in After-Effects. I’m using windows 10 running on a MacBook with a Retina display. The same panel on macOS works fine, even after changing the display scaling in macOS’s preferences.

I’ll check it across versions / apps if I get a chance and report back. Thanks again for the interest in looking into this.