diff --git a/src/extension.ts b/src/extension.ts index 04b567a..a97eb8b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -55,10 +55,16 @@ export default class RoundedWindowCorners extends Extension { if (layoutManager._startingUp) { const id = layoutManager.connect ('startup-complete', () => { this._window_actor_tracker?.enable () + if (settings ().enable_preferences_entry) { + UI.SetupBackgroundMenu () + } layoutManager.disconnect (id) }) } else { this._window_actor_tracker?.enable () + if (settings ().enable_preferences_entry) { + UI.SetupBackgroundMenu () + } } const self = this @@ -204,10 +210,6 @@ export default class RoundedWindowCorners extends Extension { }) } - if (settings ().enable_preferences_entry) { - UI.SetupBackgroundMenu () - } - const c = connections.get () // Gnome-shell will not disable extensions when _logout/shutdown/restart diff --git a/src/utils/ui.ts b/src/utils/ui.ts index a4375ee..88d7e9d 100644 --- a/src/utils/ui.ts +++ b/src/utils/ui.ts @@ -120,6 +120,7 @@ export const AddBackgroundMenuItem = (menu: BackgroundMenu) => { /** Find all Background menu, then add extra item to it */ export const SetupBackgroundMenu = () => { for (const _bg of global.window_group.first_child.get_children ()) { + _log ('Found Desktop Background obj', _bg) const menu = (_bg as typeof _bg & BackgroundExtra)._backgroundMenu AddBackgroundMenuItem (menu) }