-
Notifications
You must be signed in to change notification settings - Fork 62
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
wl: Support multiple wl_seats #623
Conversation
8e70423
to
bce7a5c
Compare
7bd5ce4
to
d3d5479
Compare
47e331a
to
a321b21
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. The first commit can land as-is, but I have a few notes on the other one. Please take a look and update the patch, or comment if you think your current approach is better 😸
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some additional comments to justify and explain the implementation details.
Wrap the creation and destruction of a Wayland display inside of the cog_wl_display_create() and cog_wl_display_destroy() functions and move these to cog-utils-wl.
a321b21
to
a43b0fc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's now nicer and easier to follow, thanks!
Patch LGTM with a small nit you may want to fix before landing.
A CogWlDisplay contains a default seat. This default value is the first seat registered and hereafter the last one activated. This is used for the shell_popup_surface and for the on_mouse_target_changed handlers. The CogWlDisplay also contains the rest of the CogWlPlatform in a list. This patch also fixes the tracking of the serials for the input methods. Now each different kind of input method for each Seat is stored individually and updated according. Still it is possible to get the latest serial using the suitable cog_wl_seat_get_serial() function. Some code was cleaned-up and relocated in cot-utils-wl as functions: cog_wl_display_add_seat; cog_wl_seat_create(); cog_wl_seat_destroy(); void cog_wl_text_input_clear(); cog_wl_text_input_set()
a43b0fc
to
5896b0b
Compare
This change extend the WL platform to support more than one WL Seat registered to the Cog app.
Now the CogWlDisplay contains a default seat. This is the first registered and then the last seat activated. This is used for the shell_popup_surface and for the on_mouse_target_changed handlers. The CogWlDisplay also contains the rest of the CogWlPlatform in a list.
The listeners associated to input methods (pointer, keyboard and touch) now pass the CogWlSeat as contextual information to the callbacks. The CogWlPlatform object is still accessible because this is attached as user_data to the wl_surface on creation time and associated to the seats as [pointer|keyboard|touch]_target then the input event is activated. These also updates what is the default seat.
This patch also fixes the tracking of the serials for the input methods. Now each different kind of input method for each Seat is stored individually and updated according. Still it is possible to get the latest serial using the suitable cog_wl_seat_get_serial() function.
Some other code was cleaned-up and relocated in cot-utils-wl as functions:
cog_wl_display_add_seat; cog_wl_seat_create(); cog_wl_seat_destroy(); void cog_wl_text_input_clear(); cog_wl_text_input_set()
.Also CogWlDisplay create/destroy logic is wrapped inside of the cog_wl_display_create() and cog_wl_display_destroy() functions and move these to cog-utils-wl.