implement shims

This commit is contained in:
Nystik
2026-03-07 14:38:51 +01:00
parent 8b43493d87
commit e70fe58459
13 changed files with 664 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
// Shim for remote.screen
// Obsidian uses screen for display/monitor info
export const screenShim = {
getPrimaryDisplay() {
return {
workAreaSize: { width: window.screen.availWidth, height: window.screen.availHeight },
size: { width: window.screen.width, height: window.screen.height },
scaleFactor: window.devicePixelRatio || 1,
bounds: { x: 0, y: 0, width: window.screen.width, height: window.screen.height },
workArea: { x: 0, y: 0, width: window.screen.availWidth, height: window.screen.availHeight },
};
},
getAllDisplays() {
return [screenShim.getPrimaryDisplay()];
},
getDisplayNearestPoint(point) {
return screenShim.getPrimaryDisplay();
},
getCursorScreenPoint() {
return { x: 0, y: 0 };
},
on() {},
once() {},
removeListener() {},
};