mirror of
https://github.com/swaywm/sway.git
synced 2025-01-30 20:56:43 +00:00
Rename get_current_time_msec to fix wlr conflict
This commit is contained in:
parent
9188a34860
commit
82c10757a3
|
@ -142,7 +142,7 @@ bool sway_set_cloexec(int fd, bool cloexec) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t get_current_time_msec(void) {
|
uint32_t sway_get_current_time_msec(void) {
|
||||||
struct timespec now;
|
struct timespec now;
|
||||||
clock_gettime(CLOCK_MONOTONIC, &now);
|
clock_gettime(CLOCK_MONOTONIC, &now);
|
||||||
return now.tv_sec * 1000 + now.tv_nsec / 1000000;
|
return now.tv_sec * 1000 + now.tv_nsec / 1000000;
|
||||||
|
|
|
@ -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);
|
bool sway_set_cloexec(int fd, bool cloexec);
|
||||||
|
|
||||||
uint32_t get_current_time_msec(void);
|
uint32_t sway_get_current_time_msec(void);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -144,14 +144,14 @@ struct cmd_results *cmd_emit(int argc, char **argv) {
|
||||||
// send key presses
|
// send key presses
|
||||||
if(action & EMIT_ACTION_PRESS) {
|
if(action & EMIT_ACTION_PRESS) {
|
||||||
for(int i = 0; i < keycodes->length; i++) {
|
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
|
// send key releases
|
||||||
if(action & EMIT_ACTION_RELEASE) {
|
if(action & EMIT_ACTION_RELEASE) {
|
||||||
for(int i = 0; i < keycodes->length; i++) {
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ struct sway_node *node_at_coords(
|
||||||
}
|
}
|
||||||
|
|
||||||
void cursor_rebase(struct sway_cursor *cursor) {
|
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);
|
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,
|
struct wlr_input_device *device, uint32_t time_msec, uint32_t button,
|
||||||
enum wl_pointer_button_state state) {
|
enum wl_pointer_button_state state) {
|
||||||
if (time_msec == 0) {
|
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);
|
seatop_button(cursor->seat, time_msec, device, button, state);
|
||||||
|
|
Loading…
Reference in a new issue