Skip to content

Commit

Permalink
Setup entry to open preferences window on background menu properly
Browse files Browse the repository at this point in the history
  • Loading branch information
yilozt committed Oct 15, 2023
1 parent 762bffc commit 092649f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/utils/ui.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}
Expand Down

0 comments on commit 092649f

Please sign in to comment.