-
Notifications
You must be signed in to change notification settings - Fork 51
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
Cannot create/quit window multiple times on Linux! #205
Comments
This appears to be a Ruby FFI bug on Linux.. I cannot reproduce with C equivalent, try this simple modification to diff --git a/examples/hello-world/main.c b/examples/hello-world/main.c
index 85658042..4471ba85 100644
--- a/examples/hello-world/main.c
+++ b/examples/hello-world/main.c
@@ -30,6 +30,17 @@ int main(void)
uiControlShow(uiControl(w));
uiMain();
+
+ // Create a new window
+ w = uiNewWindow("Hello World!", 300, 30, 0);
+ uiWindowOnClosing(w, onClosing, NULL);
+
+ l = uiNewLabel("Hello, World!");
+ uiWindowSetChild(w, uiControl(l));
+
+ uiControlShow(uiControl(w));
+ uiMain();
+
uiUninit();
return 0;
} |
OK, thank you for confirming. I should have checked with the Ruby FFI binding project first. I initially did run my own tests with the Ruby FFI binding low-level code and confirmed the issue was there, but I mistakenly concluded the issue was caused by the C libui project. In any case, I reported it to the LibUI Ruby FFI project: I will close this issue for now given you confirmed that it cannot be reproduced in C libui code. |
Thanks @cody271 for looking into the issue. |
Hi,
I got multiple issue reports on the Glimmer DSL for LibUI project about not being able to create/quit a main window multiple times on Linux (getting a segfault):
I confirmed that this works correctly on the Mac though. I am able to create a window, start the main event loop. quit the LibUI event loop, create another window, restart the main event loop, and finally quit again.
So, this seems like a Linux issue only. It is problametic because it prevents users from being able to launch/close/relaunch windows in the same Ruby application. To get around it, they could script multiple Ruby applications I suppose, but it would be great if libui-ng behaved consistently in Linux and Mac with regards to being able to launch a window multiple times.
If you need further information about the issue, please let me know.
Thank you in any case for continuing to maintain libui-ng. It's a very convenient cross-platform GUI library.
The text was updated successfully, but these errors were encountered: