Skip to content

Fixes to mouse mode confined and captured#21753

Merged
akien-mga merged 1 commit into
godotengine:masterfrom
guilhermefelipecgs:fix_confined_mode
Sep 12, 2018
Merged

Fixes to mouse mode confined and captured#21753
akien-mga merged 1 commit into
godotengine:masterfrom
guilhermefelipecgs:fix_confined_mode

Conversation

@guilhermefelipecgs

@guilhermefelipecgs guilhermefelipecgs commented Sep 4, 2018

Copy link
Copy Markdown
Contributor

CONFINED and CAPTURED will work on Linux in the same way as Windows.

When mouse mode is CAPTURED, the cursor (global/green dot) will be forced to center.

Fix #21744.
Fix #21751. The "cursor" doesn't leaves our planet anymore.

Screencast from Linux (using mouse):
peek 05-09-2018 11-33
(using pen in absolute mode)
peek 05-09-2018 11-52

Considerations:

On Windows, pen and touch doesn't work in captured mode. Issue opened #21779.

Update

Also fix free camera for Linux. The camera stop when the "cursor" leaves the viewport.
Tested with 5307043, 3.0.6 and 3.1 alpha:
peek 06-09-2018 13-22
After this PR:
peek 06-09-2018 13-23

@guilhermefelipecgs guilhermefelipecgs changed the title Fix MOUSE_MODE_CONFINED forcing cursor to center [WIP] Fix MOUSE_MODE_CONFINED forcing cursor to center Sep 5, 2018
These modes will work on Linux in the same way as Windows.
@guilhermefelipecgs guilhermefelipecgs changed the title [WIP] Fix MOUSE_MODE_CONFINED forcing cursor to center Fixes to mouse mode confined and capture Sep 5, 2018
@guilhermefelipecgs guilhermefelipecgs changed the title Fixes to mouse mode confined and capture Fixes to mouse mode confined and captured Sep 5, 2018
@akien-mga akien-mga added this to the 3.1 milestone Sep 5, 2018
@guilhermefelipecgs

guilhermefelipecgs commented Sep 6, 2018

Copy link
Copy Markdown
Contributor Author

This should be cherrypicked after merge because fix free camera that also affect 3.0.6 and 3.1 alpha.

@akien-mga

Copy link
Copy Markdown
Member

There's also @moiman100's #20491 which is pending a merge and addresses a similar concern, so I'm not sure if we should merge both, or only one of them, or a mix of the two. Could you guys compare the two and see what the final outcome should be? :)

@akien-mga

Copy link
Copy Markdown
Member

Also how does it work with #19191 if we were to merge that one too before or after this PR?

@guilhermefelipecgs

guilhermefelipecgs commented Sep 12, 2018

Copy link
Copy Markdown
Contributor Author

There's also @moiman100's #20491 which is pending a merge and addresses a similar concern, so I'm not sure if we should merge both, or only one of them, or a mix of the two. Could you guys compare the two and see what the final outcome should be? :)

I tested #20491 for Linux and I think we shouldn't merge it, his changes doesn't look good when using get_global_mouse_position or get_viewport().get_mouse_position(). See here:
peek 12-09-2018 11-12
global position should not be moved in captured mode.

My PR already fix #20491 and I'm also fixing confined mode.

Also how does it work with #19191 if we were to merge that one too before or after this PR?

You can merge both in this case, both are needed (but one don't depend of the other). I already tested local with both PRs and it should not generate any conflict (the order doesn't matter).

@akien-mga

Copy link
Copy Markdown
Member

Thanks for testing. Let's merge this one then :)

@akien-mga akien-mga merged commit fe78aa0 into godotengine:master Sep 12, 2018
@guilhermefelipecgs guilhermefelipecgs deleted the fix_confined_mode branch September 12, 2018 20:45
@akien-mga

Copy link
Copy Markdown
Member

Now that Godot 3.1 has been released, we only plan to cherry-pick critical bug fixes to the 3.0 branch, unless there is very strong support in favor of a specific non-critical issue. Removing cherrypick label for 3.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

X11: Cursor in captured mode is broken for devices working in absolute mode Mouse modes CONFINED and CAPTURE force cursor to center of window.

3 participants