intel / ozone-wayland

Wayland implementation for Chromium Ozone classes
BSD 3-Clause "New" or "Revised" License
218 stars 82 forks source link

Cursor images are offset #409

Open hobbitalastair opened 9 years ago

hobbitalastair commented 9 years ago

This is possibly related to #343 - the cursor images are offset, and I don't remember them being before. Specifically, the:

hobbitalastair commented 9 years ago

I've noticed that the cursor offset problem appears to be caused by the larger Weston cursor image being used, not the native Chromium one. Also, the cursor sometimes stays with the smaller image, even after being moved outside of the Chromium window. However, the horizontal offset is more puzzling.

michaelforney commented 9 years ago

I looked into this. BitmapCursorFactoryOzone uses the implicit Cursor(int type) constructor when it calls GetCursorBitmap, which initializes the scale factor of the cursor to 0.0. GetCursorBitmap returns the hot_1x hotspot only when the scale factor is 1.0, so we end up with cursor hotspots for the large cursors, even when the normal sized cursor are being shown. I'm not sure what the correct fix is, because BitmapCursorFactoryOzone doesn't know what scale factor to use, but setting it to 1.0f, as in the linked diff, fixed the issue for me.

https://gist.github.com/bfa2a4fb3abf37057497

hobbitalastair commented 8 years ago

Still the same as of SouthSister. Thanks michaelforney for investigating.