Skip to content

Commit

Permalink
Cleanup always on top
Browse files Browse the repository at this point in the history
  • Loading branch information
oneup03 committed Jul 20, 2024
1 parent 1def6fd commit 3a4591c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions vrto3d/src/hmd_device_driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -428,8 +428,8 @@ void MockControllerDeviceDriver::PoseUpdateThread()
static int height_sleep = 0;
static int top_sleep = 0;
static bool always_on_top = false;
static HWND vr_window;
static HWND top_window;
static HWND vr_window = NULL;
static HWND top_window = NULL;

while ( is_active_ )
{
Expand All @@ -443,6 +443,12 @@ void MockControllerDeviceDriver::PoseUpdateThread()
vr_window = FindWindow(NULL, L"Headset Window");
}
}
else if (top_window != NULL) {
top_window = NULL;
if (vr_window != NULL) {
SetWindowPos(vr_window, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
}

// Inform the vrserver that our tracked device's pose has updated, giving it the pose returned by our GetPose().
vr::VRServerDriverHost()->TrackedDevicePoseUpdated( device_index_, GetPose(), sizeof( vr::DriverPose_t ) );
Expand Down

0 comments on commit 3a4591c

Please sign in to comment.