mimecorg / vuido

Native desktop applications using Vue.js.

Home Page:https://vuido.mimec.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Only update when the mouse moves in front of the window?

vinhjaxt opened this issue · comments

Hello contributors,
I have some questions here.
Here is my code:

setInterval(() => {
console.log('Tick tock')
}, 1000)

I think it will write on the console every second: tick tock
but no, it will only print when i move the mouse in front of the window :(
Is it right?
However, at some point, I will write:

setTimeout(() => {
// do sth
}, ms)

and it was never triggered until I moved the mouse? @@
Please give me an answer. Thank you.

I think something has blocked the main thread.

I guess it's a problem with libui-node because it replaces the standard setTimeout and setInterval methods.

I guess it's a problem with libui-node because it replaces the standard setTimeout and setInterval methods.

(Yes. This issue is the reason why libui-node originially replaced these functions, don't know why it is still happening though.)

Yes, I think so, I will close this issue because it does not belong to Vuido.
Thanks everyone.

const libui = require('libui-node')
libui.startLoop()
setInterval(() => console.log('tick'), 1000)

This code solves my problem, thanks again.