Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Native Color Picker on MacOS is drawn in the wrong place #1568

Closed
maddyaby opened this issue Jan 7, 2025 · 0 comments · Fixed by #1569
Closed

Native Color Picker on MacOS is drawn in the wrong place #1568

maddyaby opened this issue Jan 7, 2025 · 0 comments · Fixed by #1569

Comments

@maddyaby
Copy link
Contributor

maddyaby commented Jan 7, 2025

Specification

  • pywebview version: latest/master
  • operating system: MacOS
  • web renderer: WebKit

Description

The y-coordinate is inverted when WebKit renders the native color picker menu over the view. This doesn't happen on Safari or Chrome, only in the Webview.

There's an isFlipped property for the view that might(?) fix it: https://developer.apple.com/documentation/appkit/nsview/isflipped
But I can't figure out how to set that, or if there's any way to intercept the native call to flip the coordinates when it draws.

I can see the mouseDown_ in WebKitHost is firing with the reversed y-coordinate system from what the web sees and those events must be flipped somewhere since the web code sees the correct positions... but the reverse direction when the color picker requests a draw is wrong.

Example:

<html>
  <body>
    <input  type="color" value="#e66465" style="position:absolute;" />
    <input  type="color" value="#e66465" style="position:absolute;left:100px;top:100px;"/>
    <input  type="color" value="#e66465" style="position:absolute;top:100px;" />
    <input  type="color" value="#e66465" style="position:absolute;left:100px;" />
  </body>
</html>

Practicalities

  • YES I am willing to work on this issue myself.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant