Skip to content

Commit 6cd7e1b

Browse files
committed
Add background throttling option, disable by default
1 parent 52670b5 commit 6cd7e1b

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

src/locales/en.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@
554554
"string": "Hidden (frameless)",
555555
"developer_comment": "Do not show the window control bar (window title, close, minimize, maximize, etc.) provided by OS. Some people call this 'frameless' mode."
556556
},
557+
"backgroundThrottling": {
558+
"string": "Allow project to be throttled when minimized or hidden"
559+
},
557560
"maxTextureDimension": {
558561
"string": "Increase max vector costume resolution to make large costumes look better. May increase memory use and cause crashes."
559562
},

src/p4/News.svelte

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,7 @@
1919
<span class="badge">New!</span>
2020
</p>
2121
<p>
22-
We've updated the packager to use the <a href="https://docs.turbowarp.org/new-compiler">new compiler</a> to make projects run even faster.
23-
</p>
24-
<p>
25-
If your project relies on extensions that require the old compiler, a version of the packager using the old compiler will be available on <a href="https://packager-legacy.turbowarp.org/">packager-legacy.turbowarp.org</a> indefinitely.
22+
By default, Electron apps will no longer pause when minimized or hidden. There is an option to restore the old behavior.
2623
</p>
2724
</div>
2825
</Section>

src/p4/PackagerOptions.svelte

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -882,7 +882,8 @@
882882
resetOptions([
883883
'app.packageName',
884884
'app.windowMode',
885-
'app.escapeBehavior'
885+
'app.escapeBehavior',
886+
'app.backgroundThrottling'
886887
]);
887888
}}
888889
>
@@ -931,6 +932,11 @@
931932
<option value="frameless">{$_('options.noControls')}</option>
932933
</select>
933934
</label>
935+
936+
<label class="option">
937+
<input type="checkbox" bind:checked={$options.app.backgroundThrottling}>
938+
{$_('options.backgroundThrottling')}
939+
</label>
934940
{/if}
935941

936942
<div class="warning">

src/packager/packager.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,7 @@ const createWindow = (windowOptions) => {
579579
contextIsolation: true,
580580
nodeIntegration: false,
581581
preload: path.resolve(__dirname, ${JSON.stringify(electronPreloadName)}),
582+
backgroundThrottling: ${this.options.app.backgroundThrottling},
582583
},
583584
frame: ${this.options.app.windowControls !== 'frameless'},
584585
show: true,
@@ -1813,7 +1814,8 @@ Packager.DEFAULT_OPTIONS = () => ({
18131814
windowMode: 'window',
18141815
version: '1.0.0',
18151816
escapeBehavior: 'unfullscreen-only',
1816-
windowControls: 'default'
1817+
windowControls: 'default',
1818+
backgroundThrottling: false
18171819
},
18181820
chunks: {
18191821
gamepad: false,

0 commit comments

Comments
 (0)