From 5ceef68fe18e49d5ac6cc4dac24f84a15eaeac25 Mon Sep 17 00:00:00 2001 From: matt1432 Date: Wed, 31 Jan 2024 15:09:03 -0500 Subject: [PATCH] fix(ags): fix latest breaking changes --- modules/ags/config/binto.ts | 3 --- modules/ags/config/services/pointers.ts | 25 ++++++++++----------- modules/ags/config/ts/misc/closer.ts | 10 ++++----- modules/ags/config/ts/notifications/base.ts | 4 ++++ modules/ags/config/wim.ts | 2 -- 5 files changed, 21 insertions(+), 23 deletions(-) diff --git a/modules/ags/config/binto.ts b/modules/ags/config/binto.ts index 0e6f3ec..b940b5b 100644 --- a/modules/ags/config/binto.ts +++ b/modules/ags/config/binto.ts @@ -10,9 +10,6 @@ const closeWinDelay = 800; // TODO: add OSD, workspace indicator / overview and current window indicator export default { - notificationPopupTimeout: 5000, - cacheNotificationActions: true, - onConfigParsed: () => { globalThis.Pointers = Pointers; }, diff --git a/modules/ags/config/services/pointers.ts b/modules/ags/config/services/pointers.ts index a89392f..a6b14ca 100644 --- a/modules/ags/config/services/pointers.ts +++ b/modules/ags/config/services/pointers.ts @@ -111,14 +111,15 @@ class Pointers extends Service { #initAppConnection() { App.connect('window-toggled', () => { const anyVisibleAndClosable = - (Array.from(App.windows) as Array<[string, PopupWindow]>) - .some((w) => { - const closable = w[1].close_on_unfocus && - !(w[1].close_on_unfocus === 'none' || - w[1].close_on_unfocus === 'stay'); + (App.windows as Array).some((w) => { + const closable = w.close_on_unfocus && + !( + w.close_on_unfocus === 'none' || + w.close_on_unfocus === 'stay' + ); - return w[1].visible && closable; - }); + return w.visible && closable; + }); if (anyVisibleAndClosable) { this.startProc(); @@ -131,15 +132,13 @@ class Pointers extends Service { } static detectClickedOutside(clickStage: string) { - const toClose = ( - Array.from(App.windows) as Array<[string, PopupWindow]> - ).some((w) => { + const toClose = ((App.windows as Array)).some((w) => { const closable = ( - w[1].close_on_unfocus && - w[1].close_on_unfocus === clickStage + w.close_on_unfocus && + w.close_on_unfocus === clickStage ); - return w[1].visible && closable; + return w.visible && closable; }); if (!toClose) { diff --git a/modules/ags/config/ts/misc/closer.ts b/modules/ags/config/ts/misc/closer.ts index e052046..a3d7e0a 100644 --- a/modules/ags/config/ts/misc/closer.ts +++ b/modules/ags/config/ts/misc/closer.ts @@ -3,11 +3,11 @@ import { PopupWindow } from 'global-types'; export default () => { - (Array.from(App.windows) as Array<[string, PopupWindow]>) - .filter((w) => - w[1].attribute.close_on_unfocus && - w[1].attribute.close_on_unfocus !== 'stay') + (App.windows as Array) + .filter((w) => w && + w.close_on_unfocus && + w.close_on_unfocus !== 'stay') .forEach((w) => { - App.closeWindow(w[0]); + App.closeWindow(w.name); }); }; diff --git a/modules/ags/config/ts/notifications/base.ts b/modules/ags/config/ts/notifications/base.ts index c0ad992..240eff2 100644 --- a/modules/ags/config/ts/notifications/base.ts +++ b/modules/ags/config/ts/notifications/base.ts @@ -25,6 +25,10 @@ import { } from 'global-types'; +// Set Notifications settings +Notifications.popupTimeout = 5000; +Notifications.cacheActions = true; + const setTime = (time: number) => { return GLib.DateTime .new_from_unix_local(time) diff --git a/modules/ags/config/wim.ts b/modules/ags/config/wim.ts index 6a2c044..b0a17d7 100644 --- a/modules/ags/config/wim.ts +++ b/modules/ags/config/wim.ts @@ -17,8 +17,6 @@ const closeWinDelay = 800; export default { - notificationPopupTimeout: 5000, - cacheNotificationActions: true, closeWindowDelay: { 'applauncher': closeWinDelay, 'calendar': closeWinDelay,