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:
parent
bf94f88569
commit
d783f134d9
9 changed files with 106 additions and 31 deletions
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue