Skip to content

Commit

Permalink
Set not maximizable/minimizable classses on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
inukshuk committed Jul 7, 2023
1 parent e61dfd5 commit e89f663
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
8 changes: 6 additions & 2 deletions src/browser/wm.js
Expand Up @@ -382,11 +382,15 @@ export class WindowManager extends EventEmitter {

let win = await this.create(type, props, opts)

// On Linux minimizable/maximizable is always true,
// so we use our default config instead.
let mmx = linux ? WindowManager.defaults[type] : win

await win.loadFile(View.expand(type), {
hash: encodeURIComponent(JSON.stringify({
...props,
maximizable: win.maximizable,
minimizable: win.minimizable
maximizable: mmx.maximizable !== false,
minimizable: mmx.minimizable !== false
}))
})

Expand Down
3 changes: 3 additions & 0 deletions src/window-controls.js
Expand Up @@ -35,6 +35,9 @@ export class WindowControls {
}

toggle(win.html, `window-controls-${this.layout.placement}`, true)
toggle(win.html, 'not-maximizable', !ARGS.maximizable)
toggle(win.html, 'not-minimizable', !ARGS.minimizable)


append(this.root, win.body)
}
Expand Down
3 changes: 0 additions & 3 deletions src/window.js
Expand Up @@ -87,9 +87,6 @@ export class Window extends EventEmitter {
if (ARGS.frameless) {
toggle(this.html, 'frameless', true)

toggle(this.html, 'not-maximizable', !ARGS.maximizable)
toggle(this.html, 'not-minimizable', !ARGS.minimizable)

if (!darwin) {
this.controls = new WindowControls()
this.controls.mount(this)
Expand Down

0 comments on commit e89f663

Please sign in to comment.