Skip to content

Commit

Permalink
Fix decoration issues on x11 on gnome-shell/mutter 44
Browse files Browse the repository at this point in the history
- Change _HIDE_FLAGS to use 0x0 in decorations fields of _MOTIF_WM_HINTS
- Change ServerDecorations.handle to use a boolean flag tracking whether the
  window decorations were previously hidden by united, because mutter now keeps
  `window->decorated` in sync with `window->mwm_decorated`
- Change ServerDecorations.decorated to use `this.win.decorated` since that flag
  is now kept up-to-date. Additionally, win.get_frame_type() now seems to never
  become Meta.FrameType.BORDER
  • Loading branch information
hyperair committed Jun 14, 2023
1 parent 9f0c85d commit 4190060
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions [email protected]/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const VALID_TYPES = [
const MOTIF_HINTS = '_MOTIF_WM_HINTS'

const _SHOW_FLAGS = ['0x2', '0x0', '0x1', '0x0', '0x0']
const _HIDE_FLAGS = ['0x2', '0x0', '0x2', '0x0', '0x0']
const _HIDE_FLAGS = ['0x2', '0x0', '0x0', '0x0', '0x0']

function isValid(win) {
return win && VALID_TYPES.includes(win.window_type)
Expand Down Expand Up @@ -59,14 +59,15 @@ var ServerDecorations = class ServerDecorations {
constructor({ xid, win }) {
this.xid = xid
this.win = win
this.hidden_by_us = false
}

get decorated() {
return this.win.get_frame_type() !== Meta.FrameType.BORDER
return this.win.decorated
}

get handle() {
return this.win.decorated
return this.hidden_by_us
}

show() {
Expand All @@ -76,7 +77,8 @@ var ServerDecorations = class ServerDecorations {
}

hide() {
if (this.handle && this.decorated) {
if (this.decorated) {
this.hidden_by_us = true
setHint(this.xid, MOTIF_HINTS, _HIDE_FLAGS)
}
}
Expand Down

0 comments on commit 4190060

Please sign in to comment.