aboutsummaryrefslogtreecommitdiffstats
path: root/sway
diff options
context:
space:
mode:
authorLibravatar Kenny Levinsen <kl@kl.wtf>2021-06-20 19:24:55 +0200
committerLibravatar Simon Ser <contact@emersion.fr>2021-06-24 18:21:29 +0200
commit04f75e6acc0aa12947be6f6d56ed593bedd4395a (patch)
treeee1bc34aecdfc89cbbeedf1ade6186579dc224ab /sway
parentOnly defer seat attachment during initial startup (diff)
downloadsway-04f75e6acc0aa12947be6f6d56ed593bedd4395a.tar.gz
sway-04f75e6acc0aa12947be6f6d56ed593bedd4395a.tar.zst
sway-04f75e6acc0aa12947be6f6d56ed593bedd4395a.zip
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. (cherry picked from commit 80315217f76e923cb19cdb76aaf9a5d177f11f61)
Diffstat (limited to 'sway')
-rw-r--r--sway/input/cursor.c7
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 @@
4#include <libevdev/libevdev.h> 4#include <libevdev/libevdev.h>
5#include <linux/input-event-codes.h> 5#include <linux/input-event-codes.h>
6#include <errno.h> 6#include <errno.h>
7#include <time.h>
7#include <strings.h> 8#include <strings.h>
8#include <wlr/types/wlr_box.h> 9#include <wlr/types/wlr_box.h>
9#include <wlr/types/wlr_cursor.h> 10#include <wlr/types/wlr_cursor.h>
@@ -31,6 +32,12 @@
31#include "sway/tree/workspace.h" 32#include "sway/tree/workspace.h"
32#include "wlr-layer-shell-unstable-v1-protocol.h" 33#include "wlr-layer-shell-unstable-v1-protocol.h"
33 34
35static uint32_t get_current_time_msec(void) {
36 struct timespec now;
37 clock_gettime(CLOCK_MONOTONIC, &now);
38 return now.tv_sec * 1000 + now.tv_nsec / 1000000;
39}
40
34static struct wlr_surface *layer_surface_at(struct sway_output *output, 41static struct wlr_surface *layer_surface_at(struct sway_output *output,
35 struct wl_list *layer, double ox, double oy, double *sx, double *sy) { 42 struct wl_list *layer, double ox, double oy, double *sx, double *sy) {
36 struct sway_layer_surface *sway_layer; 43 struct sway_layer_surface *sway_layer;