aboutsummaryrefslogtreecommitdiff
path: root/rootston
diff options
context:
space:
mode:
Diffstat (limited to 'rootston')
-rw-r--r--rootston/README.md18
-rw-r--r--rootston/cursor.c17
-rw-r--r--rootston/desktop.c2
-rw-r--r--rootston/output.c4
4 files changed, 40 insertions, 1 deletions
diff --git a/rootston/README.md b/rootston/README.md
new file mode 100644
index 00000000..be2e6698
--- /dev/null
+++ b/rootston/README.md
@@ -0,0 +1,18 @@
+# rootston
+
+Rootston is the "big" wlroots test compositor. It implements basically every
+feature of wlroots and may be useful as a reference for new compositors.
+However, it's mostly used as a testbed for wlroots development and does not have
+particularly clean code and is not particularly well designed: proceed with a
+grain of salt. It is not designed for end-users.
+
+## Running rootston
+
+If you followed the build instructions in `../README.md`, the rootston
+executable can be found at `build/rootston/rootston`. To use it, refer to the
+example config at [rootston/rootston.ini.example][rootston.ini] and place a
+config file of your own at `rootston.ini` in the working directory (or in an
+arbitrary location via `rootston -C`). Other options are available, refer to
+`rootston -h`.
+
+[rootston.ini]: https://github.com/swaywm/wlroots/blob/master/rootston/rootston.ini.example
diff --git a/rootston/cursor.c b/rootston/cursor.c
index b9ded30e..d2d3b510 100644
--- a/rootston/cursor.c
+++ b/rootston/cursor.c
@@ -35,7 +35,8 @@ void roots_cursor_destroy(struct roots_cursor *cursor) {
// TODO
}
-static void seat_view_deco_motion(struct roots_seat_view *view, double deco_sx, double deco_sy) {
+static void seat_view_deco_motion(struct roots_seat_view *view,
+ double deco_sx, double deco_sy) {
struct roots_cursor *cursor = view->seat->cursor;
double sx = deco_sx;
@@ -310,6 +311,14 @@ void roots_cursor_handle_motion(struct roots_cursor *cursor,
double dx = event->delta_x;
double dy = event->delta_y;
+ double dx_unaccel = event->unaccel_dx;
+ double dy_unaccel = event->unaccel_dy;
+
+ wlr_relative_pointer_manager_v1_send_relative_motion(
+ cursor->seat->input->server->desktop->relative_pointer_manager,
+ cursor->seat->seat, (uint64_t)event->time_msec * 1000, dx, dy,
+ dx_unaccel, dy_unaccel);
+
if (cursor->active_constraint) {
struct roots_view *view = cursor->pointer_view->view;
assert(view);
@@ -349,6 +358,12 @@ void roots_cursor_handle_motion_absolute(struct roots_cursor *cursor,
wlr_cursor_absolute_to_layout_coords(cursor->cursor, event->device, event->x,
event->y, &lx, &ly);
+ double dx = lx - cursor->cursor->x;
+ double dy = ly - cursor->cursor->y;
+ wlr_relative_pointer_manager_v1_send_relative_motion(
+ cursor->seat->input->server->desktop->relative_pointer_manager,
+ cursor->seat->seat, (uint64_t)event->time_msec * 1000, dx, dy, dx, dy);
+
if (cursor->pointer_view) {
struct roots_view *view = cursor->pointer_view->view;
diff --git a/rootston/desktop.c b/rootston/desktop.c
index 5e9e352a..d65266e5 100644
--- a/rootston/desktop.c
+++ b/rootston/desktop.c
@@ -1082,6 +1082,8 @@ struct roots_desktop *desktop_create(struct roots_server *server,
wlr_presentation_create(server->wl_display, server->backend);
desktop->foreign_toplevel_manager_v1 =
wlr_foreign_toplevel_manager_v1_create(server->wl_display);
+ desktop->relative_pointer_manager =
+ wlr_relative_pointer_manager_v1_create(server->wl_display);
wlr_data_control_manager_v1_create(server->wl_display);
diff --git a/rootston/output.c b/rootston/output.c
index f950d4dc..df8328dd 100644
--- a/rootston/output.c
+++ b/rootston/output.c
@@ -67,6 +67,10 @@ static void surface_for_each_surface(struct wlr_surface *surface,
static void view_for_each_surface(struct roots_view *view,
struct layout_data *layout_data, wlr_surface_iterator_func_t iterator,
void *user_data) {
+ if (!view->wlr_surface) {
+ return;
+ }
+
layout_data->x = view->box.x;
layout_data->y = view->box.y;
layout_data->width = view->wlr_surface->current.width;