aboutsummaryrefslogtreecommitdiff
path: root/rootston/cursor.c
diff options
context:
space:
mode:
authorTony Crisci <tony@dubstepdish.com>2017-12-08 06:11:27 -0500
committerGitHub <noreply@github.com>2017-12-08 06:11:27 -0500
commit703df2a6711322fac90581f2005750b5a72dd148 (patch)
tree96bf5e33d9c5d95842ba7813f5e37c28693d52ae /rootston/cursor.c
parentf469784bbc73bf6346430a2caa7dc366ad2d0308 (diff)
parent4c60072be584a7ed5b97de325994217a9e96bbd4 (diff)
Merge pull request #470 from acrisci/feature/xcursor-edges
wlr-edges
Diffstat (limited to 'rootston/cursor.c')
-rw-r--r--rootston/cursor.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index f0e3d70d..d38e40a1 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -8,6 +8,7 @@
#endif
#include <wlr/types/wlr_xcursor_manager.h>
#include <wlr/util/log.h>
+#include <wlr/util/edges.h>
#include "rootston/xcursor.h"
#include "rootston/cursor.h"
@@ -75,22 +76,22 @@ static void roots_cursor_update_position(struct roots_cursor *cursor,
double y = view->y;
int width = cursor->view_width;
int height = cursor->view_height;
- if (cursor->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_TOP) {
+ if (cursor->resize_edges & WLR_EDGE_TOP) {
y = cursor->view_y + dy;
height -= dy;
if (height < 1) {
y += height;
}
- } else if (cursor->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_BOTTOM) {
+ } else if (cursor->resize_edges & WLR_EDGE_BOTTOM) {
height += dy;
}
- if (cursor->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_LEFT) {
+ if (cursor->resize_edges & WLR_EDGE_LEFT) {
x = cursor->view_x + dx;
width -= dx;
if (width < 1) {
x += width;
}
- } else if (cursor->resize_edges & ROOTS_CURSOR_RESIZE_EDGE_RIGHT) {
+ } else if (cursor->resize_edges & WLR_EDGE_RIGHT) {
width += dx;
}
@@ -147,14 +148,14 @@ static void roots_cursor_press_button(struct roots_cursor *cursor,
case BTN_RIGHT:
edges = 0;
if (sx < view->wlr_surface->current->width/2) {
- edges |= ROOTS_CURSOR_RESIZE_EDGE_LEFT;
+ edges |= WLR_EDGE_LEFT;
} else {
- edges |= ROOTS_CURSOR_RESIZE_EDGE_RIGHT;
+ edges |= WLR_EDGE_RIGHT;
}
if (sy < view->wlr_surface->current->height/2) {
- edges |= ROOTS_CURSOR_RESIZE_EDGE_TOP;
+ edges |= WLR_EDGE_TOP;
} else {
- edges |= ROOTS_CURSOR_RESIZE_EDGE_BOTTOM;
+ edges |= WLR_EDGE_BOTTOM;
}
roots_seat_begin_resize(seat, view, edges);
break;