@lvce-editor/main-process 6.19.3 → 6.19.5
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/mainProcessMain.js +45 -3
- package/package.json +1 -1
package/dist/mainProcessMain.js
CHANGED
|
@@ -3727,7 +3727,8 @@ const enable$1 = parsedCliArgs => {
|
|
|
3727
3727
|
if (parsedCliArgs.sandbox) {
|
|
3728
3728
|
enableSandbox();
|
|
3729
3729
|
} else {
|
|
3730
|
-
//
|
|
3730
|
+
// The GPU sandbox must also be disabled when Chromium's sandbox was explicitly disabled.
|
|
3731
|
+
// See https://github.com/microsoft/vscode/issues/151187#issuecomment-1221475319
|
|
3731
3732
|
if (isLinux) {
|
|
3732
3733
|
// @ts-ignore
|
|
3733
3734
|
appendCommandLineSwitch('--disable-gpu-sandbox');
|
|
@@ -4037,7 +4038,7 @@ const parseCliArgs = argv => {
|
|
|
4037
4038
|
},
|
|
4038
4039
|
boolean: [Version, Help, Wait, BuiltinSelfTest, Web, SandBox],
|
|
4039
4040
|
default: {
|
|
4040
|
-
sandbox:
|
|
4041
|
+
sandbox: true
|
|
4041
4042
|
},
|
|
4042
4043
|
string: [Prompt]
|
|
4043
4044
|
};
|
|
@@ -6254,6 +6255,39 @@ const getKeyBindingIdentifier = input => {
|
|
|
6254
6255
|
return identifier;
|
|
6255
6256
|
};
|
|
6256
6257
|
|
|
6258
|
+
const MaxZoomLevel = 3;
|
|
6259
|
+
const MinZoomLevel = -3;
|
|
6260
|
+
const ZoomDelta = 0.2;
|
|
6261
|
+
const getZoomDelta = input => {
|
|
6262
|
+
if (!input.control || input.alt || input.meta) {
|
|
6263
|
+
return 0;
|
|
6264
|
+
}
|
|
6265
|
+
if (input.key === '+' || input.key === '=') {
|
|
6266
|
+
return ZoomDelta;
|
|
6267
|
+
}
|
|
6268
|
+
if (input.key === '-') {
|
|
6269
|
+
return -ZoomDelta;
|
|
6270
|
+
}
|
|
6271
|
+
return 0;
|
|
6272
|
+
};
|
|
6273
|
+
const handleWebContentsViewZoomKeyBinding = (webContentsId, input) => {
|
|
6274
|
+
const delta = getZoomDelta(input);
|
|
6275
|
+
if (delta === 0) {
|
|
6276
|
+
return false;
|
|
6277
|
+
}
|
|
6278
|
+
const state = get$3(webContentsId);
|
|
6279
|
+
if (!state) {
|
|
6280
|
+
return false;
|
|
6281
|
+
}
|
|
6282
|
+
const {
|
|
6283
|
+
webContents
|
|
6284
|
+
} = state.view;
|
|
6285
|
+
const currentZoomLevel = webContents.getZoomLevel();
|
|
6286
|
+
const newZoomLevel = Math.max(MinZoomLevel, Math.min(MaxZoomLevel, currentZoomLevel + delta));
|
|
6287
|
+
webContents.setZoomLevel(newZoomLevel);
|
|
6288
|
+
return true;
|
|
6289
|
+
};
|
|
6290
|
+
|
|
6257
6291
|
const key$7 = 'before-input';
|
|
6258
6292
|
const attach$7 = (webContents, listener) => {
|
|
6259
6293
|
webContents.on(BeforeInputEvent, listener);
|
|
@@ -6261,13 +6295,21 @@ const attach$7 = (webContents, listener) => {
|
|
|
6261
6295
|
const detach$7 = (webContents, listener) => {
|
|
6262
6296
|
webContents.off(BeforeInputEvent, listener);
|
|
6263
6297
|
};
|
|
6264
|
-
const handler$7 = (event, input) => {
|
|
6298
|
+
const handler$7 = (event, input, webContentsId) => {
|
|
6265
6299
|
if (input.type !== KeyDown) {
|
|
6266
6300
|
return {
|
|
6267
6301
|
messages: [],
|
|
6268
6302
|
result: undefined
|
|
6269
6303
|
};
|
|
6270
6304
|
}
|
|
6305
|
+
const didZoom = handleWebContentsViewZoomKeyBinding(webContentsId, input);
|
|
6306
|
+
if (didZoom) {
|
|
6307
|
+
event.preventDefault();
|
|
6308
|
+
return {
|
|
6309
|
+
messages: [],
|
|
6310
|
+
result: undefined
|
|
6311
|
+
};
|
|
6312
|
+
}
|
|
6271
6313
|
const falltroughKeyBindings = getFallthroughKeyBindings();
|
|
6272
6314
|
const identifier = getKeyBindingIdentifier(input);
|
|
6273
6315
|
// @ts-ignore
|