The 2 seconds is arbitrarily chosen. The problem seems to be that
Valve's own overlays are not being initialized before custom overlays,
leading to the Desktop overlay sometimes not being present when our
overlay initializes.
The second if statement inside the first one checking a second time is
definitely a little disgusting, but for now it gets the job done.
The 4.0 default was arbitrarily chosen by whoever decided to initialize
the variable in the class.
Since the OpenVR initialization code is no longer inside the
overlaycontroller there is no need for it to be available during object
construction. Therefore it doesn't make sense to have it be an object.
The shutdown call was completely removed because shutdowns are handled
by an OpenVR event that calls the relevant shutdown code. The destructor
for the old object was never called, removing it adds clarity to the
actual operation of the code and also removes unnecessary code.
The old shutdown code did not correctly exit but instead just
continuously called the QApplication notify function until it
SEGFAULTed. This led to crashes whenever SteamVR was shut down. Users
with Windows Error Reporting turned on would get a 100+ MB crashdump
file along with increased shutdown time for SteamVR.
For clarity the shutdown functions should probably be collected in a
single function.
clang-tidy is currently set up with errors for all checks that do not
warn. This is to prevent regressing the repo.
Gradually these warnings should be removed in order to prevent further
regresssions in warnings that do not have many occurences.
`tval.tv_usec` is a (signed) `long` and `ssPrec->m_offset` is an
`unsigned int`. Clang warns upon realizing that we are attempting to
divide a signed `long` with an `unsigned int`.
Casting the `long` to `unsigned long` makes both operands `unsigned` and
allows for auto conversion to `size_t`.
The `size_t` cast is to make it apparent that the cast is correct.