Telegram listens for a signal that indicates when the color-scheme
changes. The signal itself includes the new value, but Telegram
currently queries for the value immediately after getting the signal.
This second round-trip is unnecessary, since the signal itself contains
the same information.
This changeset avoids this follow-up query, and drops the now-unused
`Setter`.
XDG is inventing new tray specification, so SNI will be outdated soon and it's better to just use QSystemTrayIcon.
I believe all the major drawbacks of QSystemTrayIcon are solved and we can live with minor ones.
Given the planned MainWindow refactoring, it seems it's the best time to do that.
QApplication has a historical feature[1] of calling setlocale(3) at init,
which today cause more harm than good. Such call isn't thread safe neither
per C standard, not per any known libc implementation. The Gio threads
would call into locale reading functions all the time, so early access to
locale by Gio may race with setlocale() by Qt leading to undefined behavior.
Platform specific start before the Sandbox (aka QApplication) is at core
design of tdesktop and that order can't be changed. There is no way to pause
Gio until QApplication instantiates.
Fortunately, Qt library itself has a static global flag that prevents it
from calling setlocale() twice. We don't even need to instantiate a
temporary QCoreApplication, we can just call into the method. So call
it form Platform::start before any existing or future calls to Gio.
Fixes#16922
[1] https://chat.stackoverflow.com/rooms/63812/discussion-between-phil-armstrong-and-matteo-italia
Since SPMediaKeyTap has been removed on Mac, Linux is the only platform where this function is implemented, but that's not really needed due to MPRIS support, so SetWatchingMediaKeys can be dropped entirely