diff --git a/src/extension.ts b/src/extension.ts index f34e865c..99f02088 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1671,7 +1671,7 @@ export class Ext extends Ecs.System { } for (const window of this.windows.values()) { - if (window.meta.is_client_decorated()) continue; + if (window.is_client_decorated()) continue; if (show_title) { window.decoration_show(this); diff --git a/src/mod.d.ts b/src/mod.d.ts index d038dece..63fc2d92 100644 --- a/src/mod.d.ts +++ b/src/mod.d.ts @@ -261,6 +261,7 @@ declare namespace Meta { appears_focused: Readonly; minimized: Readonly; window_type: Readonly; + decorated: Readonly; activate(time: number): void; change_workspace_by_index(workspace: number, append: boolean): void; @@ -285,7 +286,6 @@ declare namespace Meta { has_focus(): boolean; is_above(): boolean; is_attached_dialog(): boolean; - is_client_decorated(): boolean; is_fullscreen(): boolean; is_on_all_workspaces(): boolean; is_override_redirect(): boolean; diff --git a/src/window.ts b/src/window.ts index f3b99366..ec794f9f 100644 --- a/src/window.ts +++ b/src/window.ts @@ -63,7 +63,7 @@ export class ShellWindow { ignore_detach: boolean = false; was_attached_to?: [Entity, boolean | number]; destroying: boolean = false; - + // Awaiting reassignment after a display update reassignment: boolean = false; @@ -103,7 +103,7 @@ export class ShellWindow { } if (this.may_decorate()) { - if (!window.is_client_decorated()) { + if (!this.is_client_decorated()) { if (ext.settings.show_title()) { this.decoration_show(ext); } else { @@ -265,6 +265,16 @@ export class ShellWindow { return WM_TITLE_BLACKLIST.findIndex((n) => name.startsWith(n)) !== -1; } + is_client_decorated(): boolean { + // look I guess I'll hack something together in here if at all possible + // Because Meta.Window.is_client_decorated() was removed in Meta 15, using it breaks the extension in gnome 47 or higher + //return this.meta.window_type == Meta.WindowType.META_WINDOW_OVERRIDE_OTHER; + const xid = this.xid() + const extents = xid ? xprop.get_frame_extents(xid) : false; + if (!extents) return false; + return true; + } + is_maximized(): boolean { return this.meta.get_maximized() !== 0; } diff --git a/src/xprop.ts b/src/xprop.ts index 865e4298..e3423df0 100644 --- a/src/xprop.ts +++ b/src/xprop.ts @@ -7,6 +7,8 @@ export var MOTIF_HINTS: string = '_MOTIF_WM_HINTS'; export var HIDE_FLAGS: string[] = ['0x2', '0x0', '0x0', '0x0', '0x0']; export var SHOW_FLAGS: string[] = ['0x2', '0x0', '0x1', '0x0', '0x0']; +//export var FRAME_EXTENTS: string = "_GTK_FRAME_EXTENTS" + export function get_window_role(xid: string): string | null { let out = xprop_cmd(xid, 'WM_WINDOW_ROLE'); @@ -15,6 +17,14 @@ export function get_window_role(xid: string): string | null { return parse_string(out); } +export function get_frame_extents(xid: string): string | null { + let out = xprop_cmd(xid, "_GTK_FRAME_EXTENTS"); + + if (!out) return null; + + return parse_string(out) +} + export function get_hint(xid: string, hint: string): Array | null { let out = xprop_cmd(xid, hint);