Skip to content

useWindowDisplay

useWindowDisplay(): DisplayInfo | null

Defined in: renderer/hooks/useWindowDisplay.ts:22

Hook to subscribe to window display info Re-renders when the window moves to a different display

DisplayInfo | null

Current display info or null if not available

function Content() {
const display = useWindowDisplay();
// { id, bounds: { x, y, width, height }, workArea, scaleFactor }
if (display) {
console.log(`Window is on display ${display.id} with scale ${display.scaleFactor}`);
}
}