feat: support dip <-> screen conversion on Linux X11 (#46895)

feat: support dip <-> screen conversion on Linux

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2025-05-02 19:08:50 -05:00 committed by GitHub
commit d783f134d9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 106 additions and 31 deletions

View file

@ -356,7 +356,7 @@ as `-webkit-app-region: drag` in a frameless window.
Calling `event.preventDefault()` will prevent the menu from being displayed.
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows).
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows-linux).
### Static Methods

View file

@ -435,7 +435,7 @@ as `-webkit-app-region: drag` in a frameless window.
Calling `event.preventDefault()` will prevent the menu from being displayed.
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows).
To convert `point` to DIP, use [`screen.screenToDipPoint(point)`](./screen.md#screenscreentodippointpoint-windows-linux).
### Static Methods

View file

@ -124,7 +124,7 @@ Returns [`Display`](structures/display.md) - The display nearest the specified p
Returns [`Display`](structures/display.md) - The display that most closely
intersects the provided bounds.
### `screen.screenToDipPoint(point)` _Windows_
### `screen.screenToDipPoint(point)` _Windows_ _Linux_
* `point` [Point](structures/point.md)
@ -133,7 +133,10 @@ Returns [`Point`](structures/point.md)
Converts a screen physical point to a screen DIP point.
The DPI scale is performed relative to the display containing the physical point.
### `screen.dipToScreenPoint(point)` _Windows_
Not currently supported on Wayland - if used there it will return the point passed
in with no changes.
### `screen.dipToScreenPoint(point)` _Windows_ _Linux_
* `point` [Point](structures/point.md)
@ -142,6 +145,8 @@ Returns [`Point`](structures/point.md)
Converts a screen DIP point to a screen physical point.
The DPI scale is performed relative to the display containing the DIP point.
Not currently supported on Wayland.
### `screen.screenToDipRect(window, rect)` _Windows_
* `window` [BrowserWindow](browser-window.md) | null