pointer-constraints: refactoring

* Rename the constraint_create signal to new_constraint for
  consistency
* Move the constraint_destroy signal to the constraint itself
* Use rotate_child_position instead of duplicating logic
* Fix inert constraint resource handling
* Style fixes
This commit is contained in:
emersion 2018-09-27 10:25:59 +02:00
parent 31cc2fa4f9
commit dac4f8e19f
9 changed files with 130 additions and 119 deletions

View file

@ -68,8 +68,7 @@ struct roots_desktop {
struct wl_listener input_inhibit_activate;
struct wl_listener input_inhibit_deactivate;
struct wl_listener virtual_keyboard_new;
struct wl_listener constraint_create;
struct wl_listener constraint_destroy;
struct wl_listener pointer_constraint;
#ifdef WLR_HAS_XWAYLAND
struct wlr_xwayland *xwayland;

View file

@ -28,6 +28,9 @@ struct roots_output {
struct wl_listener damage_destroy;
};
void rotate_child_position(double *sx, double *sy, double sw, double sh,
double pw, double ph, float rotation);
void handle_new_output(struct wl_listener *listener, void *data);
struct roots_view;

View file

@ -122,6 +122,12 @@ struct roots_tablet_tool {
struct wl_listener tablet_destroy;
};
struct roots_pointer_constraint {
struct wlr_pointer_constraint_v1 *constraint;
struct wl_listener destroy;
};
struct roots_seat *roots_seat_create(struct roots_input *input, char *name);
void roots_seat_destroy(struct roots_seat *seat);