From 82c10757a33170e9f48ccf112ae60d9fad9342f7 Mon Sep 17 00:00:00 2001 From: Tert0 <62036464+Tert0@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:41:34 +0100 Subject: [PATCH] Rename get_current_time_msec to fix wlr conflict --- common/util.c | 2 +- include/util.h | 2 +- sway/commands/emit.c | 4 ++-- sway/input/cursor.c | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/common/util.c b/common/util.c index d61c92958..878b893f9 100644 --- a/common/util.c +++ b/common/util.c @@ -142,7 +142,7 @@ bool sway_set_cloexec(int fd, bool cloexec) { return true; } -uint32_t get_current_time_msec(void) { +uint32_t sway_get_current_time_msec(void) { struct timespec now; clock_gettime(CLOCK_MONOTONIC, &now); return now.tv_sec * 1000 + now.tv_nsec / 1000000; diff --git a/include/util.h b/include/util.h index 94a18ffa9..9f9d5b199 100644 --- a/include/util.h +++ b/include/util.h @@ -61,6 +61,6 @@ const char *sway_wl_output_subpixel_to_string(enum wl_output_subpixel subpixel); bool sway_set_cloexec(int fd, bool cloexec); -uint32_t get_current_time_msec(void); +uint32_t sway_get_current_time_msec(void); #endif diff --git a/sway/commands/emit.c b/sway/commands/emit.c index 06defefb7..74ba5cbe4 100644 --- a/sway/commands/emit.c +++ b/sway/commands/emit.c @@ -144,14 +144,14 @@ struct cmd_results *cmd_emit(int argc, char **argv) { // send key presses if(action & EMIT_ACTION_PRESS) { for(int i = 0; i < keycodes->length; i++) { - wlr_seat_keyboard_notify_key(seat->wlr_seat, get_current_time_msec(), *((uint32_t*) keycodes->items[i])-8, 1); + wlr_seat_keyboard_notify_key(seat->wlr_seat, sway_get_current_time_msec(), *((uint32_t*) keycodes->items[i])-8, 1); } } // send key releases if(action & EMIT_ACTION_RELEASE) { for(int i = 0; i < keycodes->length; i++) { - wlr_seat_keyboard_notify_key(seat->wlr_seat, get_current_time_msec(), *((uint32_t*) keycodes->items[i])-8, 0); + wlr_seat_keyboard_notify_key(seat->wlr_seat, sway_get_current_time_msec(), *((uint32_t*) keycodes->items[i])-8, 0); } } diff --git a/sway/input/cursor.c b/sway/input/cursor.c index d36e3f13a..d0df928c8 100644 --- a/sway/input/cursor.c +++ b/sway/input/cursor.c @@ -138,7 +138,7 @@ struct sway_node *node_at_coords( } void cursor_rebase(struct sway_cursor *cursor) { - uint32_t time_msec = get_current_time_msec(); + uint32_t time_msec = sway_get_current_time_msec(); seatop_rebase(cursor->seat, time_msec); } @@ -353,7 +353,7 @@ void dispatch_cursor_button(struct sway_cursor *cursor, struct wlr_input_device *device, uint32_t time_msec, uint32_t button, enum wl_pointer_button_state state) { if (time_msec == 0) { - time_msec = get_current_time_msec(); + time_msec = sway_get_current_time_msec(); } seatop_button(cursor->seat, time_msec, device, button, state);