@netless/window-manager 0.4.36 → 0.4.37
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/CHANGELOG.md +5 -1
- package/dist/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +11 -8
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js +2 -2
- package/dist/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/BoxManager.ts +12 -8
package/package.json
CHANGED
package/src/BoxManager.ts
CHANGED
@@ -108,6 +108,18 @@ export class BoxManager {
|
|
108
108
|
callbacks.emit("prefersColorSchemeChange", colorScheme);
|
109
109
|
});
|
110
110
|
|
111
|
+
// ppt 在最小化后刷新恢复正常大小,拿不到正确的宽高,需要手动触发一下窗口的 resize
|
112
|
+
this.teleBoxManager._minimized$.reaction(minimized => {
|
113
|
+
if (!minimized) {
|
114
|
+
setTimeout(() => {
|
115
|
+
const offset = 0.001 * (Math.random() > 0.5 ? 1 : -1);
|
116
|
+
this.teleBoxManager.boxes.forEach(box => {
|
117
|
+
box.resize(box.intrinsicWidth + offset, box.intrinsicHeight + offset, true);
|
118
|
+
});
|
119
|
+
}, 400);
|
120
|
+
}
|
121
|
+
});
|
122
|
+
|
111
123
|
// events.on 的值则会根据 skipUpdate 来决定是否触发回调
|
112
124
|
this.teleBoxManager.events.on("minimized", minimized => {
|
113
125
|
this.context.safeSetAttributes({ minimized });
|
@@ -120,14 +132,6 @@ export class BoxManager {
|
|
120
132
|
this.context.setAppFocus(topBox.id);
|
121
133
|
this.focusBox({ appId: topBox.id }, false);
|
122
134
|
}
|
123
|
-
// ppt 在最小化后刷新恢复正常大小,拿不到正确的宽高,需要手动触发一下窗口的 resize
|
124
|
-
setTimeout(() => {
|
125
|
-
this.teleBoxManager.boxes.forEach(box => {
|
126
|
-
const width = box.width;
|
127
|
-
const height = box.height;
|
128
|
-
box._size$.setValue({ width: width + 0.001, height: height + 0.001 }, true);
|
129
|
-
});
|
130
|
-
}, 100);
|
131
135
|
}
|
132
136
|
});
|
133
137
|
this.teleBoxManager.events.on("maximized", maximized => {
|