assert cursor layout for move and warp functions

master
Tony Crisci 7 years ago
parent 0cba06dcef
commit f69a7afd36

@ -65,6 +65,7 @@ void wlr_cursor_set_xcursor(struct wlr_cursor *cur, struct wlr_xcursor *xcur) {
} }
bool wlr_cursor_warp(struct wlr_cursor *cur, double x, double y) { bool wlr_cursor_warp(struct wlr_cursor *cur, double x, double y) {
assert(cur->state->layout);
if (!wlr_output_layout_output_at(cur->state->layout, x, y)) { if (!wlr_output_layout_output_at(cur->state->layout, x, y)) {
return false; return false;
} }
@ -95,7 +96,6 @@ bool wlr_cursor_warp(struct wlr_cursor *cur, double x, double y) {
} }
void wlr_cursor_move(struct wlr_cursor *cur, double delta_x, double delta_y) { void wlr_cursor_move(struct wlr_cursor *cur, double delta_x, double delta_y) {
// TODO handle no layout
assert(cur->state->layout); assert(cur->state->layout);
int x = cur->x + delta_x; int x = cur->x + delta_x;

Loading…
Cancel
Save