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

Add confine pointer #76

Closed
wants to merge 5 commits into from
Closed

Conversation

Cherser-s
Copy link

Resolves #72. It doesn't look good right now, and I didn't add the ability to grab pointer for new seats that can be added after pointer grab yet, since it requires providing new_seat method with surface reference.

@elinorbgr
Copy link
Member

Hi, thanks for working on this!

Before all, could you explain me why you merged this logic with the Frame implementations, rather than creating a new module with this specific logic? Is there some coupling between them?

@Cherser-s
Copy link
Author

Well because frames (and not window module) are holding references to WlPointer right now, so I thought that would be more convenient.
So I think to add some kind of get_pointers method to Frame module instead. (still requires updating pointer grab on new seat in case if new seat is created)
Also, I don't know whether it's better to constrain all available seats to surface at once, or constrain only specified one.

@elinorbgr
Copy link
Member

A SCTK user would normally also have a WlPointer at hand without using the one internal to the Window/Frames, and separating the two would make for a more flexible API overall I think: users may wish to confine the pointer to some other surface than the one backing a Window.

In this approach, I guess we could have some API allowing the app to constrain a given pointer to a given surface, something like that.

@Cherser-s
Copy link
Author

Ok, so Environment should contain an module for pointer grab (which contains a pointer_constraints object from the start and methods for both pointer confinement and lock).

@elinorbgr
Copy link
Member

I think ideally this code should be separated into its own module (like the data_device, keyboard or pointer modules). Though this does raise some questions of API design for SCTK I had in mind for some time. Will make an issue about that.

@Cherser-s
Copy link
Author

Cherser-s commented Jul 8, 2019

In this case there is no need to even implement API for that purpose since all you need to do is call one method (whether it is lock_pointer or confine_pointer). Client does only need to hold reference to created object to destroy it if needed. Or maybe just add wrapper for it to support multiple versions. (just in case API changes later since it is unstable by now)

@elinorbgr
Copy link
Member

I'm going to close this, given this appear to need more design thought. Please head to #77 if you want to discuss this further. :)

@elinorbgr elinorbgr closed this Oct 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for pointer grab
2 participants