diff options
author | Kenny Levinsen <kl@kl.wtf> | 2021-06-20 19:24:55 +0200 |
---|---|---|
committer | Simon Ser <contact@emersion.fr> | 2021-06-23 09:55:36 +0200 |
commit | 80315217f76e923cb19cdb76aaf9a5d177f11f61 (patch) | |
tree | 59a519c26f1803c168bbf8154e72e1c9a95e2fc1 /sway | |
parent | f81dc1ecc00a6a5516699ca74a7b4de4098b3f72 (diff) | |
download | sway-80315217f76e923cb19cdb76aaf9a5d177f11f61.tar.xz |
input: Move get_current_time_msec in from util
get_current_time_msec is only used in cursor.c, so we can move it in and
make it static. This is primarily intended to avoid a symbol collision
with wlroots, which we unfortunately do not have a good solution for
yet.
Diffstat (limited to 'sway')
-rw-r--r-- | sway/input/cursor.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/sway/input/cursor.c b/sway/input/cursor.c index cbb5c6e9..c89d5166 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -4,6 +4,7 @@ #include <libevdev/libevdev.h> #include <linux/input-event-codes.h> #include <errno.h> +#include <time.h> #include <strings.h> #include <wlr/types/wlr_box.h> #include <wlr/types/wlr_cursor.h> @@ -31,6 +32,12 @@ #include "sway/tree/workspace.h" #include "wlr-layer-shell-unstable-v1-protocol.h" +static uint32_t get_current_time_msec(void) { + struct timespec now; + clock_gettime(CLOCK_MONOTONIC, &now); + return now.tv_sec * 1000 + now.tv_nsec / 1000000; +} + static struct wlr_surface *layer_surface_at(struct sway_output *output, struct wl_list *layer, double ox, double oy, double *sx, double *sy) { struct sway_layer_surface *sway_layer; |