Skip to content

Commit 3f0e411

Browse files
committed
fix(api/application/menu.js): double encode for linux
1 parent c8c942d commit 3f0e411

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

api/application/menu.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { MenuItemEvent } from '../internal/events.js'
33
import { Deferred } from '../async.js'
44
import ipc from '../ipc.js'
5+
import os from '../os.js'
56

67
let contextMenuDeferred = null
78

@@ -450,6 +451,7 @@ export default container
450451
* @ignore
451452
*/
452453
export async function setMenu (options, type) {
454+
options = { ...options }
453455
const menu = options.value
454456

455457
// validate the menu
@@ -537,6 +539,10 @@ export async function setMenu (options, type) {
537539
: 'application.setSystemMenu'
538540
)
539541

542+
if (os.platform() === 'linux') {
543+
options.value = encodeURIComponent(options.value)
544+
}
545+
540546
return await ipc.send(command, options)
541547
}
542548

0 commit comments

Comments
 (0)