@walldock/agent 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/screens/windows.js +3 -2
- package/dist/sync.js +1 -0
- package/package.json +1 -1
package/dist/screens/windows.js
CHANGED
|
@@ -15,7 +15,7 @@ using System.Runtime.InteropServices;
|
|
|
15
15
|
public class MonitorHelper {
|
|
16
16
|
[DllImport("user32.dll")] public static extern bool EnumDisplayMonitors(IntPtr hdc, IntPtr clip, MonitorEnumProc cb, IntPtr data);
|
|
17
17
|
[DllImport("shcore.dll")] public static extern int GetDpiForMonitor(IntPtr hMon, int type, out uint dpiX, out uint dpiY);
|
|
18
|
-
[DllImport("user32.dll")] public static extern bool GetMonitorInfo(IntPtr hMon, ref MonitorInfo info);
|
|
18
|
+
[DllImport("user32.dll", CharSet=CharSet.Auto)] public static extern bool GetMonitorInfo(IntPtr hMon, ref MonitorInfo info);
|
|
19
19
|
[StructLayout(LayoutKind.Sequential)] public struct RECT { public int L,T,R,B; }
|
|
20
20
|
[StructLayout(LayoutKind.Sequential, CharSet=CharSet.Auto)]
|
|
21
21
|
public struct MonitorInfo {
|
|
@@ -27,8 +27,9 @@ public class MonitorHelper {
|
|
|
27
27
|
private static bool Callback(IntPtr hMon, IntPtr hdc, ref RECT rc, IntPtr data) {
|
|
28
28
|
var info = new MonitorInfo(); info.Size = (uint)Marshal.SizeOf(info);
|
|
29
29
|
GetMonitorInfo(hMon, ref info);
|
|
30
|
-
uint dx, dy;
|
|
30
|
+
uint dx = 96, dy = 96;
|
|
31
31
|
GetDpiForMonitor(hMon, 0, out dx, out dy);
|
|
32
|
+
if (dx == 0) dx = 96;
|
|
32
33
|
double scale = dx / 96.0;
|
|
33
34
|
int w = info.Monitor.R - info.Monitor.L;
|
|
34
35
|
int h = info.Monitor.B - info.Monitor.T;
|
package/dist/sync.js
CHANGED
|
@@ -102,6 +102,7 @@ class SyncService {
|
|
|
102
102
|
const fp = (0, index_1.fingerprintScreens)(screens);
|
|
103
103
|
if (fp === this.lastScreensFingerprint)
|
|
104
104
|
return;
|
|
105
|
+
this.callbacks.onLog(`[screens] detected ${screens.length}: ${screens.map(s => `${s.label}(${s.width}x${s.height})`).join(', ')}`);
|
|
105
106
|
try {
|
|
106
107
|
await this.api.reportDeviceScreens(ctx.token, ctx.deviceId, screens);
|
|
107
108
|
this.lastScreensFingerprint = fp;
|