forked from pyrite-dev/milsko
wayland: oops! we have MwTimeGetTick, we should use that (even though I'm not sure if that's consistent across platforms. but it will at least compile
This commit is contained in:
parent
052863dcfe
commit
884c05acb7
3 changed files with 10 additions and 12 deletions
|
|
@ -838,7 +838,7 @@ static void keyboard_key(void* data,
|
|||
MwLLDispatch(self, key_released, &key);
|
||||
self->wayland.holding_key = MwFALSE;
|
||||
}
|
||||
clock_gettime(CLOCK_REALTIME, &self->wayland.start_time);
|
||||
self->wayland.start_time = MwTimeGetTick();
|
||||
self->wayland.next_elapsed = self->wayland.keyboard_delay;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1150,12 +1150,10 @@ static int MwLLPendingImpl(MwLL handle) {
|
|||
handle->wayland.setting_wh = 0;
|
||||
}
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &handle->wayland.end_time);
|
||||
handle->wayland.end_time = MwTimeGetTick();
|
||||
|
||||
if(handle->wayland.holding_key) {
|
||||
double elapsed = ((double)(handle->wayland.end_time.tv_sec - handle->wayland.start_time.tv_sec) * 1.0e9 +
|
||||
(double)(handle->wayland.end_time.tv_nsec - handle->wayland.start_time.tv_nsec)) /
|
||||
1000000.0;
|
||||
float elapsed = ((float)(handle->wayland.end_time - (float)handle->wayland.start_time));
|
||||
if(elapsed >= handle->wayland.next_elapsed) {
|
||||
MwLL topmost_parent = handle;
|
||||
while(topmost_parent->wayland.parent) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue