Skip to content

Commit 0774d69

Browse files
jmmarananmmstick
authored andcommitted
fix: enable max-state hint on multi-display only
1 parent 47d4829 commit 0774d69

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/mod.d.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -153,9 +153,9 @@ declare namespace Meta {
153153
}
154154

155155
enum MaximizeFlags {
156-
HORIZONTAL,
157-
VERTICAL,
158-
BOTH
156+
HORIZONTAL = 1,
157+
VERTICAL = 2,
158+
BOTH = 3
159159
}
160160

161161
enum MotionDirection {
@@ -187,6 +187,7 @@ declare namespace Meta {
187187
delete(timestamp: number): void;
188188
get_buffer_rect(): Rectangular;
189189
get_compositor_private(): Clutter.Actor | null;
190+
get_display(): Meta.Display | null;
190191
get_description(): string;
191192
get_frame_rect(): Rectangular;
192193
get_maximized(): number;

src/window.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,8 @@ export class ShellWindow {
238238
}
239239

240240
is_maximized(): boolean {
241-
return this.meta.get_maximized() !== 0;
241+
let maximized = this.meta.get_maximized() === 3;
242+
return maximized;
242243
}
243244

244245
/**
@@ -399,7 +400,9 @@ export class ShellWindow {
399400
this.restack();
400401
if (this.ext.settings.active_hint()) {
401402
let border = this.border;
403+
let monitor_count = this.meta.get_display().get_n_monitors();
402404
if (!this.meta.is_fullscreen() &&
405+
!(this.is_maximized() && monitor_count == 1) &&
403406
!this.meta.minimized &&
404407
this.same_workspace()) {
405408
if (this.meta.appears_focused) {
@@ -424,8 +427,8 @@ export class ShellWindow {
424427
*/
425428
restack(updateState: RESTACK_STATE = RESTACK_STATE.NORMAL) {
426429
this.update_border_layout();
427-
428-
if (this.meta.is_fullscreen()) {
430+
let monitor_count = this.meta.get_display().get_n_monitors();
431+
if (this.meta.is_fullscreen() || (this.is_max_screen() && monitor_count == 1)) {
429432
this.hide_border()
430433
}
431434

@@ -641,4 +644,4 @@ function pointer_already_on_window(meta: Meta.Window): boolean {
641644
const cursor = lib.cursor_rect()
642645

643646
return cursor.intersects(meta.get_frame_rect())
644-
}
647+
}

0 commit comments

Comments
 (0)