fix(ags): fix latest breaking changes
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-31 15:09:03 -05:00
parent 31ef9691da
commit 5ceef68fe1
5 changed files with 21 additions and 23 deletions

View file

@ -10,9 +10,6 @@ const closeWinDelay = 800;
// TODO: add OSD, workspace indicator / overview and current window indicator // TODO: add OSD, workspace indicator / overview and current window indicator
export default { export default {
notificationPopupTimeout: 5000,
cacheNotificationActions: true,
onConfigParsed: () => { onConfigParsed: () => {
globalThis.Pointers = Pointers; globalThis.Pointers = Pointers;
}, },

View file

@ -111,13 +111,14 @@ class Pointers extends Service {
#initAppConnection() { #initAppConnection() {
App.connect('window-toggled', () => { App.connect('window-toggled', () => {
const anyVisibleAndClosable = const anyVisibleAndClosable =
(Array.from(App.windows) as Array<[string, PopupWindow]>) (App.windows as Array<PopupWindow>).some((w) => {
.some((w) => { const closable = w.close_on_unfocus &&
const closable = w[1].close_on_unfocus && !(
!(w[1].close_on_unfocus === 'none' || w.close_on_unfocus === 'none' ||
w[1].close_on_unfocus === 'stay'); w.close_on_unfocus === 'stay'
);
return w[1].visible && closable; return w.visible && closable;
}); });
if (anyVisibleAndClosable) { if (anyVisibleAndClosable) {
@ -131,15 +132,13 @@ class Pointers extends Service {
} }
static detectClickedOutside(clickStage: string) { static detectClickedOutside(clickStage: string) {
const toClose = ( const toClose = ((App.windows as Array<PopupWindow>)).some((w) => {
Array.from(App.windows) as Array<[string, PopupWindow]>
).some((w) => {
const closable = ( const closable = (
w[1].close_on_unfocus && w.close_on_unfocus &&
w[1].close_on_unfocus === clickStage w.close_on_unfocus === clickStage
); );
return w[1].visible && closable; return w.visible && closable;
}); });
if (!toClose) { if (!toClose) {

View file

@ -3,11 +3,11 @@ import { PopupWindow } from 'global-types';
export default () => { export default () => {
(Array.from(App.windows) as Array<[string, PopupWindow]>) (App.windows as Array<PopupWindow>)
.filter((w) => .filter((w) => w &&
w[1].attribute.close_on_unfocus && w.close_on_unfocus &&
w[1].attribute.close_on_unfocus !== 'stay') w.close_on_unfocus !== 'stay')
.forEach((w) => { .forEach((w) => {
App.closeWindow(w[0]); App.closeWindow(w.name);
}); });
}; };

View file

@ -25,6 +25,10 @@ import {
} from 'global-types'; } from 'global-types';
// Set Notifications settings
Notifications.popupTimeout = 5000;
Notifications.cacheActions = true;
const setTime = (time: number) => { const setTime = (time: number) => {
return GLib.DateTime return GLib.DateTime
.new_from_unix_local(time) .new_from_unix_local(time)

View file

@ -17,8 +17,6 @@ const closeWinDelay = 800;
export default { export default {
notificationPopupTimeout: 5000,
cacheNotificationActions: true,
closeWindowDelay: { closeWindowDelay: {
'applauncher': closeWinDelay, 'applauncher': closeWinDelay,
'calendar': closeWinDelay, 'calendar': closeWinDelay,