Skip to content

Commit

Permalink
Clear all signal handlers when gnome-shell is shutdown
Browse files Browse the repository at this point in the history
Fix #26
  • Loading branch information
LuoYi committed Aug 7, 2022
1 parent 838ffeb commit bb465e8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,16 @@ export class Extension {
AddBackgroundMenuItem (actor._backgroundMenu)
}

// Gnome-shell will not disable extensions when logout/shutdown/restart
// system, it means that the signal handlers will not be cleaned when
// gnome-shell is closing.
//
// Now clear all resources manually before gnome-shell closes
Connections.get ().connect (global.display, 'closing', () => {
log ('Clear all resources because gnome-shell is shutdown')
this.disable ()
})

log ('Enabled')
}

Expand Down
4 changes: 3 additions & 1 deletion src/manager/rounded-corners-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,9 @@ export class RoundedCornersManager {
const wm = global.window_manager

// Try to add rounded corners effect to all windows
for (const actor of global.get_window_actors ()) {
const window_actors = global.get_window_actors ()
_log (`Windows count when enable: ${window_actors.length}`)
for (const actor of window_actors) {
this._add_effect (actor)
}

Expand Down

0 comments on commit bb465e8

Please sign in to comment.