{"action":"created","issue":{"url":"https://api.github.com/repos/SFML/SFML/issues/1016","repository_url":"https://api.github.com/repos/SFML/SFML","labels_url":"https://api.github.com/repos/SFML/SFML/issues/1016/labels{/name}","comments_url":"https://api.github.com/repos/SFML/SFML/issues/1016/comments","events_url":"https://api.github.com/repos/SFML/SFML/issues/1016/events","html_url":"https://github.com/SFML/SFML/issues/1016","id":121033644,"number":1016,"title":"Fail to create render window with a native handle on Linux","user":{"login":"fallahn","id":5619252,"avatar_url":"https://avatars.githubusercontent.com/u/5619252?v=3","gravatar_id":"","url":"https://api.github.com/users/fallahn","html_url":"https://github.com/fallahn","followers_url":"https://api.github.com/users/fallahn/followers","following_url":"https://api.github.com/users/fallahn/following{/other_user}","gists_url":"https://api.github.com/users/fallahn/gists{/gist_id}","starred_url":"https://api.github.com/users/fallahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fallahn/subscriptions","organizations_url":"https://api.github.com/users/fallahn/orgs","repos_url":"https://api.github.com/users/fallahn/repos","events_url":"https://api.github.com/users/fallahn/events{/privacy}","received_events_url":"https://api.github.com/users/fallahn/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/SFML/SFML/labels/bug","name":"bug","color":"ff4242"},{"url":"https://api.github.com/repos/SFML/SFML/labels/m:sfml-window","name":"m:sfml-window","color":"cccccc"},{"url":"https://api.github.com/repos/SFML/SFML/labels/p:linux","name":"p:linux","color":"888888"},{"url":"https://api.github.com/repos/SFML/SFML/labels/s:undecided","name":"s:undecided","color":"ffe20a"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2015-12-08T15:39:43Z","updated_at":"2016-10-02T14:05:50Z","closed_at":null,"body":"As discussed with Tank on IRC:\r\n\r\nThis could, of course, be the fault of a third party library but:\r\n\r\nOS: Ubuntu 15.10 64bit, Compiler: gcc 5, SFML 2.3.2\r\nUsing the [nana UI library](https://github.com/cnjinhao/nana) trying to create a control with a render window attached fails with:\r\n\r\nX Error of failed request:  BadAccess (attempt to access private resource denied)\r\n  Major opcode of failed request:  2 (X_ChangeWindowAttributes)\r\n  Serial number of failed request:  61\r\n  Current serial number in output stream:  69\r\nterminate called without an active exception\r\nAborted (core dumped)\r\n\r\nStepping into RenderWindow::create() the debugger points to the constructor of ContextSettings before throwing the error.\r\n\r\nCall stack:\r\n#0 0x7ffff66b9267\t__GI_raise(sig=sig@entry=6) (../sysdeps/unix/sysv/linux/raise.c:55)\r\n#1 0x7ffff66baeca\t__GI_abort() (abort.c:89)\r\n#2 0x7ffff6cf4b7d\t__gnu_cxx::__verbose_terminate_handler() () (/usr/lib/x86_64-linux-gnu/libstdc++.so.6:??)\r\n#3 0x7ffff6cf29c6\t??() (/usr/lib/x86_64-linux-gnu/libstdc++.so.6:??)\r\n#4 0x7ffff6cf2a11\tstd::terminate() () (/usr/lib/x86_64-linux-gnu/libstdc++.so.6:??)\r\n#5 0x86a4e1\tstd::thread::~thread() () (??:??)\r\n#6 0x86e60e\tstd::default_delete<std::thread>::operator()(std::thread*) (??:??)\r\n#7 0x86c241\tstd::unique_ptr<std::thread, std::default_delete<std::thread> >::~unique_ptr() () (??:??)\r\n#8 0x86c082\tnana::detail::msg_dispatcher::~msg_dispatcher() () (??:??)\r\n#9 0x8657fd\tnana::detail::platform_spec::~platform_spec() () (??:??)\r\n#10 0x7ffff66bdd32\t__run_exit_handlers(status=1, listp=0x7ffff6a48698 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) (exit.c:82)\r\n#11 0x7ffff66bdd85\t__GI_exit(status=<optimised out>) (exit.c:104)\r\n#12 0x7ffff7459b18\t_XDefaultError() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#13 0x7ffff7459c4d\t_XError() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#14 0x7ffff7456ad7\t??() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#15 0x7ffff7456b95\t??() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#16 0x7ffff7457555\t_XEventsQueued() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#17 0x7ffff745a385\t_XGetRequest() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#18 0x7ffff743e495\t_XGetWindowAttributes() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#19 0x7ffff743e6a1\tXGetWindowAttributes() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#20 0x7ffff74828c3\t??() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#21 0x7ffff74832d0\t_XimSetICDefaults() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#22 0x7ffff748333e\t_XimSetICDefaults() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#23 0x7ffff747ebda\t_XimLocalCreateIC() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#24 0x7ffff7464653\tXCreateIC() (/usr/lib/x86_64-linux-gnu/libX11.so.6:??)\r\n#25 0x7ffff7978228\tsf::priv::WindowImplX11::WindowImplX11(unsigned long) () (/usr/local/lib/libsfml-window.so.2.3:??)\r\n#26 0x7ffff796e551\tsf::priv::WindowImpl::create(unsigned long) () (/usr/local/lib/libsfml-window.so.2.3:??)\r\n#27 0x7ffff796e19e\tsf::Window::create(unsigned long, sf::ContextSettings const&) () (/usr/local/lib/libsfml-window.so.2.3:??)\r\n#28 0x767e9c\tPreviewWindow::start(this=0x7fffffffe478, parent=...) (/home/captain/bgrll/bgrll/src/PreviewWindow.cpp:40)\r\n#29 0x7512f2\tMainWindow::MainWindow()::{lambda()#1}::operator()() const() (/home/captain/bgrll/bgrll/src/MainWindow.cpp:49)\r\n\r\n\r\nThe following can be used to reproduce the problem:\r\n\r\n    #include <nana/gui/wvl.hpp>\r\n    #include <SFML/Graphics/RenderWindow.hpp>\r\n\r\n    int main()\r\n    {   \r\n        nana::form form;\r\n\r\n        sf::RenderWindow rw;\r\n        rw.create(reinterpret_cast<sf::WindowHandle>(form.native_handle()));\r\n\r\n        form.events().destroy([&rw]() { rw.close(); });\r\n        form.events().focus([&rw]() {rw.clear(sf::Color(50, 60, 50)); rw.display(); });\r\n\r\n        form.show();\r\n        nana::exec();\r\n\r\n        return 0;\r\n    }\r\n\r\nThe above works fine on Windows using VS2015 (as does my actual use case).\r\n\r\nPossibly related is the X11 example which builds and runs, but closing the window leaves the SFML windows behind:\r\n![](http://djfallen.com/images/x11.png)"},"comment":{"url":"https://api.github.com/repos/SFML/SFML/issues/comments/250972909","html_url":"https://github.com/SFML/SFML/issues/1016#issuecomment-250972909","issue_url":"https://api.github.com/repos/SFML/SFML/issues/1016","id":250972909,"user":{"login":"fallahn","id":5619252,"avatar_url":"https://avatars.githubusercontent.com/u/5619252?v=3","gravatar_id":"","url":"https://api.github.com/users/fallahn","html_url":"https://github.com/fallahn","followers_url":"https://api.github.com/users/fallahn/followers","following_url":"https://api.github.com/users/fallahn/following{/other_user}","gists_url":"https://api.github.com/users/fallahn/gists{/gist_id}","starred_url":"https://api.github.com/users/fallahn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fallahn/subscriptions","organizations_url":"https://api.github.com/users/fallahn/orgs","repos_url":"https://api.github.com/users/fallahn/repos","events_url":"https://api.github.com/users/fallahn/events{/privacy}","received_events_url":"https://api.github.com/users/fallahn/received_events","type":"User","site_admin":false},"created_at":"2016-10-02T14:05:50Z","updated_at":"2016-10-02T14:05:50Z","body":"Just tried this with the lastest revisions of SFML and nana, the output remains the same as the original post."}}
{"actor":{"display_login":"fallahn"}}