aboutsummaryrefslogtreecommitdiff
path: root/rootston/cursor.c
diff options
context:
space:
mode:
authoremersion <contact@emersion.fr>2017-12-14 20:31:18 +0100
committeremersion <contact@emersion.fr>2017-12-14 20:31:18 +0100
commit466e86b7b2cbefa55ad5b85a97ee8257c24cb81b (patch)
treecc1691ec5abefdffcb8ac6312574ffa03bc4049a /rootston/cursor.c
parenteb763439f75d3c9174280d0c75ef44941dd99340 (diff)
parenta9fb071d49b244b72846b384a9e2ef2d9b03a05f (diff)
Merge branch 'master' into surface-transform
Diffstat (limited to 'rootston/cursor.c')
-rw-r--r--rootston/cursor.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/rootston/cursor.c b/rootston/cursor.c
index f0e3d70d..95e8ce2a 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"
@@ -21,6 +22,7 @@ struct roots_cursor *roots_cursor_create(struct roots_seat *seat) {
free(cursor);
return NULL;
}
+ cursor->default_xcursor = ROOTS_XCURSOR_DEFAULT;
return cursor;
}
@@ -47,7 +49,7 @@ static void roots_cursor_update_position(struct roots_cursor *cursor,
}
if (set_compositor_cursor) {
wlr_xcursor_manager_set_cursor_image(cursor->xcursor_manager,
- ROOTS_XCURSOR_DEFAULT, cursor->cursor);
+ cursor->default_xcursor, cursor->cursor);
cursor->cursor_client = NULL;
}
if (view) {
@@ -75,22 +77,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 +149,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;