GUIRestart
From MixxxWiki
Overview
In general the Mixxx user interface code was not designed to allow the skin to be changed while the application is running. There are lots of pointers held to user interface elements created at startup which means that deleting the user interface and starting a new one doesn't even come close to working.
What we have sort of works by luck almost and is certainly not a terribly scientific solution. There are probably pointers left hanging somewhere. Basically I wouldn't recommend doing it in situations where Mixxx musn't crash, like live performance.
Also because it's a hack, other elements shouldn't be designed around it. If writing your change the right way breaks changing skins, then it's the changing skins code that needs to be fixed, not yours.
How It Works
So to minimise the effects of dangling pointers, we reuse all the GUI elements that MixxxView holds on to when it creates the user interface. We call their setup() functions again with the new skin information and do one or two extra calls to force them to set up all their children properly when necessary. Things like WPushButtons that cannot be reused are deleted and new ones are created for the new skin. This is ok because things don't tend to need pointers back to buttons in the same way that the engine classes need pointers back to the waveform displays for example.
Broken at the moment
- If the new skin doesn't have waveform summaries then they don't get moved properly
- Waveform summaries seem to disappear for the playing track when skin changes


