Added very basic cursor tracking

No interaction with wayland clients yet. Just draws the cursor where
the pointer device points.
This commit is contained in:
Veselin Ivanov 2018-10-04 20:56:47 +03:00
parent 4d2c67040c
commit 4f231567a7
6 changed files with 90 additions and 1 deletions

18
include/waybox/cursor.h Normal file
View file

@ -0,0 +1,18 @@
#ifndef CURSOR_H
#define CURSOR_H
#include <wayland-server.h>
#include <wlr/types/wlr_cursor.h>
#include <wlr/types/wlr_xcursor_manager.h>
struct wb_cursor {
struct wlr_cursor *cursor;
struct wlr_xcursor_manager *xcursor_manager;
struct wl_listener cursor_motion;
struct wl_listener cursor_motion_absolute;
};
struct wb_cursor *wb_cursor_create();
void wb_cursor_destroy(struct wb_cursor *cursor);
#endif // cursor.h

View file

@ -19,9 +19,10 @@
#include <wlr/types/wlr_matrix.h>
#include <wlr/types/wlr_gamma_control.h>
#include <wlr/types/wlr_primary_selection.h>
#include <wlr/types/wlr_output_layout.h>
#include "waybox/output.h"
#include "waybox/cursor.h"
struct wb_server {
struct wl_display *wl_display;
@ -30,7 +31,11 @@ struct wb_server {
struct wlr_backend *backend;
struct wlr_compositor *compositor;
struct wlr_output_layout *layout;
struct wb_cursor *cursor;
struct wl_listener new_output;
struct wl_listener new_input;
struct wl_list outputs; // wb_output::link
};