MCPcopy Index your code
hub / github.com/wavetermdev/waveterm / getDisplayForQuakeToggle

Function getDisplayForQuakeToggle

emain/emain-window.ts:920–934  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

918}
919
920function getDisplayForQuakeToggle() {
921 // We cannot reliably query the OS-wide active window in Electron.
922 // Cursor position is the best cross-platform proxy for the user's active display.
923 const cursorPoint = screen.getCursorScreenPoint();
924 const displayAtCursor = screen
925 .getAllDisplays()
926 .find(
927 (display) =>
928 cursorPoint.x >= display.bounds.x &&
929 cursorPoint.x < display.bounds.x + display.bounds.width &&
930 cursorPoint.y >= display.bounds.y &&
931 cursorPoint.y < display.bounds.y + display.bounds.height
932 );
933 return displayAtCursor ?? screen.getDisplayNearestPoint(cursorPoint);
934}
935
936function moveWindowToDisplay(win: WaveBrowserWindow, targetDisplay: Electron.Display) {
937 if (!win || !targetDisplay || win.isDestroyed()) {

Callers 1

quakeToggleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected