assert cursor layout for move and warp functions

This commit is contained in:
Tony Crisci 2017-08-24 10:53:11 -04:00
parent 0cba06dcef
commit f69a7afd36
1 changed files with 1 additions and 1 deletions

View File

@ -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;