Allow to know the shell restarting state
I have making a WORKAROUND of a problem inside the qt windows app, to resolve a similar problem that cause this issue: https://bugzilla.gnome.org/show_bug.cgi?id=781760
The idea is store in a persistent way the current active DBus
connection properties of a windows and after a lock screen or a shell restart, reconstruct the connections from the saved properties.
As i want to save just the current actives windows, i need to differentiate a normal close of a windows (by a user request or an application behaviour) with a shell restart, because if:
- Is a normal behaviour: I need to remove the window properties from the list, because this window is not anymore active.
-
Is a shell restart: I need to keep saved the window properties, because when the shell startup again i need to reconstruct the
Dbus
connection from that properties.
Finally i end up with a problem of differentiate if a shell is restarting or not, when the Shell.WindowTracker
inform me that a windows is not inside the WindowTracker
list anymore.
It will be easy if i can connect my extension to the global.display 'restart'
signal, but in Main
the shell is preventing me to capture that signal, because it always return true.
global.display.connect('restart', () => {
global.reexec_self();
return true;
});
One easy way, is just add another variable in Main
to be set to true
, when the shell is in restarting state.