diff options
author | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-31 20:28:36 +1000 |
---|---|---|
committer | Ryan Dwyer <ryandwyer1@gmail.com> | 2018-10-31 23:56:20 +1000 |
commit | 528c7495bb09e18a8b63e1c741b90f65ff5541c6 (patch) | |
tree | b1dddeefb15f2511b33f7bed52d0df3b4110d8f8 /sway/input/cursor.c | |
parent | Merge pull request #3031 from atomnuker/master (diff) | |
download | sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.tar.gz sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.tar.zst sway-528c7495bb09e18a8b63e1c741b90f65ff5541c6.zip |
Move view border properties to container struct
This will be needed to implement layout saving and restoring, as we need
to be able to configure borders on a placeholder container which has no
view.
Diffstat (limited to 'sway/input/cursor.c')
-rw-r--r-- | sway/input/cursor.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index 7ede48bf..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, | |||
187 | if (!cont->view) { | 187 | if (!cont->view) { |
188 | return WLR_EDGE_NONE; | 188 | return WLR_EDGE_NONE; |
189 | } | 189 | } |
190 | struct sway_view *view = cont->view; | 190 | if (cont->border == B_NONE || !cont->border_thickness || |
191 | if (view->border == B_NONE || !view->border_thickness || | 191 | cont->border == B_CSD) { |
192 | view->border == B_CSD) { | ||
193 | return WLR_EDGE_NONE; | 192 | return WLR_EDGE_NONE; |
194 | } | 193 | } |
195 | 194 | ||
196 | enum wlr_edges edge = 0; | 195 | enum wlr_edges edge = 0; |
197 | if (cursor->cursor->x < cont->x + view->border_thickness) { | 196 | if (cursor->cursor->x < cont->x + cont->border_thickness) { |
198 | edge |= WLR_EDGE_LEFT; | 197 | edge |= WLR_EDGE_LEFT; |
199 | } | 198 | } |
200 | if (cursor->cursor->y < cont->y + view->border_thickness) { | 199 | if (cursor->cursor->y < cont->y + cont->border_thickness) { |
201 | edge |= WLR_EDGE_TOP; | 200 | edge |= WLR_EDGE_TOP; |
202 | } | 201 | } |
203 | if (cursor->cursor->x >= cont->x + cont->width - view->border_thickness) { | 202 | if (cursor->cursor->x >= cont->x + cont->width - cont->border_thickness) { |
204 | edge |= WLR_EDGE_RIGHT; | 203 | edge |= WLR_EDGE_RIGHT; |
205 | } | 204 | } |
206 | if (cursor->cursor->y >= cont->y + cont->height - view->border_thickness) { | 205 | if (cursor->cursor->y >= cont->y + cont->height - cont->border_thickness) { |
207 | edge |= WLR_EDGE_BOTTOM; | 206 | edge |= WLR_EDGE_BOTTOM; |
208 | } | 207 | } |
209 | 208 | ||