Make thread_data global and refactor desktop widget

The desktop widget was the only widget tied to thread_data, and
required to be refactored in the same commit.