diff options
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 3942b64f..c539df40 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -187,23 +187,22 @@ static enum wlr_edges find_edge(struct sway_container *cont, if (!cont->view) { return WLR_EDGE_NONE; } - struct sway_view *view = cont->view; - if (view->border == B_NONE || !view->border_thickness || - view->border == B_CSD) { + if (cont->border == B_NONE || !cont->border_thickness || + cont->border == B_CSD) { return WLR_EDGE_NONE; } enum wlr_edges edge = 0; - if (cursor->cursor->x < cont->x + view->border_thickness) { + if (cursor->cursor->x < cont->x + cont->border_thickness) { edge |= WLR_EDGE_LEFT; } - if (cursor->cursor->y < cont->y + view->border_thickness) { + if (cursor->cursor->y < cont->y + cont->border_thickness) { edge |= WLR_EDGE_TOP; } - if (cursor->cursor->x >= cont->x + cont->width - view->border_thickness) { + if (cursor->cursor->x >= cont->x + cont->width - cont->border_thickness) { edge |= WLR_EDGE_RIGHT; } - if (cursor->cursor->y >= cont->y + cont->height - view->border_thickness) { + if (cursor->cursor->y >= cont->y + cont->height - cont->border_thickness) { edge |= WLR_EDGE_BOTTOM; } @@ -585,7 +584,7 @@ static void cursor_do_rebase(struct sway_cursor *cursor, uint32_t time_msec, void cursor_rebase(struct sway_cursor *cursor) { uint32_t time_msec = get_current_time_msec(); - struct wlr_surface *surface; + struct wlr_surface *surface = NULL; double sx, sy; cursor->previous.node = node_at_coords(cursor->seat, cursor->cursor->x, cursor->cursor->y, &surface, &sx, &sy); |