From d5a66b02d8d30f4cd3c8e488b1b0f2ba1703d03c Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 20 Aug 2021 16:40:56 +0200 Subject: [PATCH 1/2] fix(build): TypeScript compiler errors were not being shown or caught --- Makefile | 2 +- scripts/transpile.sh | 6 +++--- src/extension.ts | 5 +---- src/panel_settings.ts | 3 --- src/window.ts | 14 ++++++++++---- 5 files changed, 15 insertions(+), 15 deletions(-) mode change 100644 => 100755 scripts/transpile.sh diff --git a/Makefile b/Makefile index f4770f49..fb5062fc 100644 --- a/Makefile +++ b/Makefile @@ -35,7 +35,7 @@ configure: sh scripts/configure.sh compile: $(sources) clean - env PROJECTS="$(PROJECTS)" sh scripts/transpile.sh + env PROJECTS="$(PROJECTS)" ./scripts/transpile.sh # Rebuild, install, reconfigure local settings, restart shell, and listen to journalctl logs debug: depcheck compile install install-system76-plugins configure enable restart-shell listen diff --git a/scripts/transpile.sh b/scripts/transpile.sh old mode 100644 new mode 100755 index 0b3bbbf6..c351e6f2 --- a/scripts/transpile.sh +++ b/scripts/transpile.sh @@ -21,10 +21,10 @@ glib-compile-schemas schemas & for proj in ${PROJECTS}; do mkdir -p _build/${proj} - tsc --p src/${proj} & + tsc --p src/${proj} done -tsc & +tsc wait @@ -34,7 +34,7 @@ cp -r metadata.json icons schemas *.css _build & for src in $(find target -name '*.js'); do dest=$(echo $src | sed s#target#_build#g) - transpile & + transpile done wait \ No newline at end of file diff --git a/src/extension.ts b/src/extension.ts index 8003e588..80e12b6f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -170,9 +170,6 @@ export class Ext extends Ecs.System { private size_requests: Map = new Map(); - /** Used to debounce on_focus triggers */ - private focus_trigger: null | SignalID = null; - // Entity-component associations /** Store for stable sequences of each registered window */ @@ -2582,7 +2579,7 @@ function _show_skip_taskbar_windows(ext: Ext) { // are skip taskbar true (meta_win.get_wm_class() !== null && !gnome_shell_wm_class) || - default_isoverviewwindow_ws(win); + default_isoverviewwindow_ws(win)); }; } } diff --git a/src/panel_settings.ts b/src/panel_settings.ts index f71fc886..83ff56c8 100644 --- a/src/panel_settings.ts +++ b/src/panel_settings.ts @@ -1,10 +1,7 @@ const Me = imports.misc.extensionUtils.getCurrentExtension(); -// import * as auto_tiler from 'auto_tiler'; import * as Utils from 'utils'; -import { Launcher } from './dialog_launcher'; -//import type { Entity } from './ecs'; import type { Ext } from './extension'; const { Clutter, Gio, St } = imports.gi; diff --git a/src/window.ts b/src/window.ts index 8d116af5..b2832cd0 100644 --- a/src/window.ts +++ b/src/window.ts @@ -253,8 +253,14 @@ export class ShellWindow { } is_single_max_screen(): boolean { - let monitor_count = this.meta.get_display().get_n_monitors(); - return (this.is_maximized() || this.smart_gapped) && monitor_count == 1; + const display = this.meta.get_display() + + if (display) { + let monitor_count = display.get_n_monitors(); + return (this.is_maximized() || this.smart_gapped) && monitor_count == 1; + } + + return false } is_snap_edge(): boolean { @@ -435,8 +441,8 @@ export class ShellWindow { */ restack(updateState: RESTACK_STATE = RESTACK_STATE.NORMAL) { this.update_border_layout(); - if (this.meta.is_fullscreen() || - (this.is_single_max_screen() && !this.is_snap_edge()) || + if (this.meta.is_fullscreen() || + (this.is_single_max_screen() && !this.is_snap_edge()) || this.meta.minimized) { this.hide_border() } From 648e11a071dad8a68f480dfdc79f180c1d1dcf6d Mon Sep 17 00:00:00 2001 From: Michael Aaron Murphy Date: Fri, 20 Aug 2021 14:34:08 +0200 Subject: [PATCH 2/2] fix: Windows not having their forks created in the correct orientation --- src/fork.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/fork.ts b/src/fork.ts index 852574ab..fa2adf26 100644 --- a/src/fork.ts +++ b/src/fork.ts @@ -73,11 +73,13 @@ export class Fork { let area: [number, number, number, number]; if (this.is_horizontal()) { - const width = this.area.width - this.length_left + ext.gap_inner; - area = [width, this.area.y, this.area.width - width, this.area.height]; + const xpos = this.area.x + this.length_left + ext.gap_inner + const width = this.area.width - this.length_left - ext.gap_inner + area = [xpos, this.area.y, width, this.area.height]; } else { - const height = this.area.height - this.length_left + ext.gap_inner; - area = [this.area.x, height, this.area.width, this.area.height - height]; + const ypos = this.area.y + this.length_left + ext.gap_inner + const height = this.area.height - this.length_left - ext.gap_inner; + area = [this.area.x, ypos, this.area.width, height]; } return new Rect.Rectangle(area);