Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement onShouldQuit with the same semnatic as libui (return true from the cb will stop the loop) #98

Open
mischnic opened this issue Apr 28, 2018 · 1 comment
Milestone

Comments

@mischnic
Copy link
Collaborator

mischnic commented Apr 28, 2018

Should return the cb's return value, currently:

libui-node/src/Ui.cc

Lines 6 to 10 in df1eefd

static int onShouldQuit_cb(void *data) {
nbind::cbFunction *cb = (nbind::cbFunction *) data;
(*cb)();
return 0;
}

How it's used by libui (pseudocode):

if (uiShouldQuitCb())
	uiQuit();
@parro-it
Copy link
Owner

We cannot let libui call uiQuit alone, because we have to call our stopLoop method instead (it call uiQuit after it had cleaned up other things).

So we can implement the same semantic, but always return 0.
Also, we'll have to implement this on JS side, because we also have to unpatch global timers functions.

@parro-it parro-it changed the title onShouldQuit Implement onShouldQuit with the same semnatic as libui (return true from the cb will stop the loop) May 3, 2018
@parro-it parro-it added this to the 0_3_0 milestone May 3, 2018
@parro-it parro-it mentioned this issue May 3, 2018
10 tasks
@parro-it parro-it modified the milestones: 0_3_0, 0.4.0 May 30, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants