Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the move bar to freely position windows #1650

Closed
wants to merge 7 commits into from
Closed

Conversation

svillar
Copy link
Member

@svillar svillar commented Nov 28, 2024

Users should be able to move the windows around (although the 3 windows will still be grouped together) by clicking and dragging in the recently added move bar bellow the window. It's also possible to modify the distance from the user to the window by moving close/away the controller used to move the windows.

We can now get rid of the window distance slider in the display settings.

I'm also removing the head lock switch from the settings as it has never been very useful and similar positioning capabilities can be achieved now with this PR.

Fixes #99, fixes #927, fixes #707

This widget replaces the experimental move windows button that could
be enabled from the Display Settings. That button was shown in the
navigation bar and was a bit weird to use.

This PR replaces it with a thing semi-transparent bar that when
dragged moves the window in the horizontal direction as the old
button used to do. That bar is unconditionally shown when in
curved mode.
Window view model's isCurved property was not properly updated when
exiting fullscreen. When entering fullscreen it's updated because
placeWindow() is called. However on unfullscreen placeWindow() is
not called so the isCurved property was not updated. The solution
is to call updateCurvedMode when entering/exiting fullscreen.
When in head lock mode, the view is automatically reoriented to where the
head is looking at. In this mode the window is always in front of user's
head. We could use the same approach to implement moving windows
behaviour. The first step is to generalize the lock mode to also
support other modes apart from head lock mode.
Use the newly added controller lock mode to perform window reorientation
instead of window moving when using the moving bar widget.

In this mode the view is reoriented to where the controller (either
physical or a hand) points to. This allows us to freely rotate
windows around the user.
By moving the controller closer or away users can now freely position
the windows also in the Z axis. So far it still respects the current
limits for near and far window distances.

This allows us to remove the slider to change the window position
in the settings as it is no longer needed.
The previous restriction of only allowing windows in curved mode
does no longer apply to the new window movement code because we
just reorient the widgets instead of moving them inside the a
cylinder. That's why moving just 1 window is possible now.
We added it as a temporary way to freely move windows while window
movement was not implemented. Now that we have it in place there is no
need to keep it in the settings. It has never been really useful.
@svillar svillar force-pushed the moving_bar_reorient branch from 4f149a4 to 9f92309 Compare November 28, 2024 16:57
@felipeerias
Copy link
Collaborator

This feature is great @svillar

👉 My first concern is that it is too easy to rotate the window and leave it in a position that is hard to use.

ScreenRecording_2024.11.29-18.08.28.mp4

Compare with the system UI (PICO in this case):

ScreenRecording_2024.11.29-18.08.06.mp4

👉 The second concern is that sometimes the window "jumps" when I click the move bar. See this video:

ScreenRecording_2024.11.29-18.11.39.mp4

👉 Finally, could we use the "grab" button in the controller as an additional way to use this feature?

@svillar
Copy link
Member Author

svillar commented Nov 29, 2024

This feature is great @svillar

👉 My first concern is that it is too easy to rotate the window and leave it in a position that is hard to use.

Right, we have complete freedom right now. What would you do? Restrict the movement in the Z axis for example? that way the window will be always in upright position, that's something that should be easy to implement.

👉 The second concern is that sometimes the window "jumps" when I click the move bar. See this video:

Yep, I'm aware of that, it's because the user grabs the bar but the widget that actually follows the controller is the window. I guess we could somehow fix that but didn't spend much time on that for this first version.

👉 Finally, could we use the "grab" button in the controller as an additional way to use this feature?

I guess so. That's mapped to the squeeze action which is also available when using hand interaction profiles (doing the gesture of closing the fist with the hand should work too). Looks like more a nice follow up than a blocker for this PR, doesn't it?

@felipeerias
Copy link
Collaborator

@svillar I'm thinking that we could remove the "roll" rotation from the controller so the window stays more or less horizontal. This was just a quick test using DeviceUtils::CalculateReorientationMatrixWithThreshold():

ScreenRecording_2024.12.02-12.08.57.trimmed.mp4

@felipeerias
Copy link
Collaborator

@svillar There are also some issues with the distance and the rotation, for example here the distance changes as I rotate the controller left and right:

ScreenRecording_2024.12.02-12.17.59.mp4

@svillar
Copy link
Member Author

svillar commented Jan 7, 2025

Superseeded by #1670

@svillar svillar closed this Jan 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants