Rename get_current_time_msec to fix wlr conflict

This commit is contained in:
Tert0 2024-12-11 22:41:34 +01:00
parent 9188a34860
commit 82c10757a3
No known key found for this signature in database
GPG key ID: 5CD17B02E0EFD576
4 changed files with 6 additions and 6 deletions

View file

@ -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;

View file

@ -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

View file

@ -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);
}
}

View file

@ -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);