MCPcopy Index your code
hub / github.com/ZToolsCenter/ZTools / getDisplayAtCursor

Method getDisplayAtCursor

src/main/managers/windowManager.ts:258–271  ·  view source on GitHub ↗

* 获取鼠标所在显示器的工作区尺寸和位置

()

Source from the content-addressed store, hash-verified

256 * 获取鼠标所在显示器的工作区尺寸和位置
257 */
258 private getDisplayAtCursor(): {
259 width: number
260 height: number
261 x: number
262 y: number
263 id: number
264 } {
265 const cursorPoint = screen.getCursorScreenPoint()
266 const display = screen.getDisplayNearestPoint(cursorPoint)
267 return {
268 ...display.workArea,
269 id: display.id
270 }
271 }
272
273 /**
274 * 获取当前显示器 ID(基于窗口位置)

Callers 2

createWindowMethod · 0.95
moveWindowToCursorMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected