{"action":"created","comment":{"url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/comments/88791343","pull_request_review_id":9355699,"id":88791343,"diff_hunk":"@@ -1,11 +1,120 @@\n+#include <queue>\n+#include <cstring>\n+#include <string>\n #include <lug/Window/Unix/WindowImplX11.hpp>\n+#include <lug/Window/Unix/WmHints.hpp>\n \n-bool lug::Window::priv::WindowImpl::create(uint16_t width, uint16_t height, const std::string& title, Style style) {\n-    return false;\n+\n+lug::Window::priv::WindowImpl::WindowImpl(Window* win): _parent{win} {}\n+\n+bool lug::Window::priv::WindowImpl::create(const std::string& title, Style style) {\n+    uint32_t blackColor = 0;\n+    uint8_t screen = 0;\n+    GC _graphic_context;\n+\n+    _display = XOpenDisplay(nullptr);\n+    if (_display == nullptr) {\n+            return false;\n+    }\n+\n+    screen = DefaultScreen(_display);\n+    _graphic_context = DefaultGC(_display, screen);\n+    ::Window parent = RootWindow(_display, screen);\n+\n+    blackColor = BlackPixel(_display, DefaultScreen(_display));\n+\n+    _window = XCreateSimpleWindow(_display, parent, 0, 0, _parent->_mode.width, _parent->_mode.height, 90, 2, blackColor);\n+\n+    if (!_window) {\n+        XCloseDisplay(_display);\n+        return false;\n+    }\n+\n+    XSelectInput(_display, _window, ExposureMask | KeyPress);\n+    XStoreName(_display, _window, title.c_str());\n+    XMapWindow(_display, _window);\n+\n+    _wmProtocols = XInternAtom(_display, \"WM_PROTOCOLS\", False);\n+    _wmDeleteWindow = XInternAtom(_display, \"WM_DELETE_WINDOW\", False);\n+    _wmHints = XInternAtom(_display, \"_MOTIF_WM_HINTS\", False);\n+\n+    XSetWMProtocols(_display, _window, &_wmDeleteWindow, 1);\n+    setWindowDecorations(style);\n+\n+    return true;\n }\n \n void lug::Window::priv::WindowImpl::close() {\n+    if (_display != nullptr) {\n+        XCloseDisplay(_display);\n+        XDestroyWindow(_display, _window);\n+        _display = nullptr;\n+        _window = 0;\n+    }\n }\n \n-void lug::Window::priv::WindowImpl::processEvents(std::queue<lug::Window::Event>& events) {\n+Bool selectEvents(Display* display, XEvent* event, XPointer arg)\n+{\n+    if (event->type == ClientMessage || event->type == DestroyNotify)\n+        return True;\n+    else","path":"src/lug/Window/Unix/WindowImplX11.cpp","position":63,"original_position":63,"commit_id":"f967db677ea780c10c964c4908dd1b796afe13f3","original_commit_id":"f967db677ea780c10c964c4908dd1b796afe13f3","user":{"login":"Quentin01","id":1022683,"avatar_url":"https://avatars.githubusercontent.com/u/1022683?v=3","gravatar_id":"","url":"https://api.github.com/users/Quentin01","html_url":"https://github.com/Quentin01","followers_url":"https://api.github.com/users/Quentin01/followers","following_url":"https://api.github.com/users/Quentin01/following{/other_user}","gists_url":"https://api.github.com/users/Quentin01/gists{/gist_id}","starred_url":"https://api.github.com/users/Quentin01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quentin01/subscriptions","organizations_url":"https://api.github.com/users/Quentin01/orgs","repos_url":"https://api.github.com/users/Quentin01/repos","events_url":"https://api.github.com/users/Quentin01/events{/privacy}","received_events_url":"https://api.github.com/users/Quentin01/received_events","type":"User","site_admin":false},"body":"Brackets?","created_at":"2016-11-20T01:00:13Z","updated_at":"2016-11-20T01:00:13Z","html_url":"https://github.com/Lugdunum3D/Lugdunum/pull/15#discussion_r88791343","pull_request_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15","_links":{"self":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/comments/88791343"},"html":{"href":"https://github.com/Lugdunum3D/Lugdunum/pull/15#discussion_r88791343"},"pull_request":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15"}}},"pull_request":{"url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15","id":91494370,"html_url":"https://github.com/Lugdunum3D/Lugdunum/pull/15","diff_url":"https://github.com/Lugdunum3D/Lugdunum/pull/15.diff","patch_url":"https://github.com/Lugdunum3D/Lugdunum/pull/15.patch","issue_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/15","number":15,"state":"open","locked":false,"title":"Feature window x11","user":{"login":"Quentin01","id":1022683,"avatar_url":"https://avatars.githubusercontent.com/u/1022683?v=3","gravatar_id":"","url":"https://api.github.com/users/Quentin01","html_url":"https://github.com/Quentin01","followers_url":"https://api.github.com/users/Quentin01/followers","following_url":"https://api.github.com/users/Quentin01/following{/other_user}","gists_url":"https://api.github.com/users/Quentin01/gists{/gist_id}","starred_url":"https://api.github.com/users/Quentin01/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Quentin01/subscriptions","organizations_url":"https://api.github.com/users/Quentin01/orgs","repos_url":"https://api.github.com/users/Quentin01/repos","events_url":"https://api.github.com/users/Quentin01/events{/privacy}","received_events_url":"https://api.github.com/users/Quentin01/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-10-29T16:38:46Z","updated_at":"2016-11-20T01:08:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"d77d74dd3fb26cb33f1c5812ed8aa3d8ae45de28","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15/commits","review_comments_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15/comments","review_comment_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/15/comments","statuses_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/statuses/f967db677ea780c10c964c4908dd1b796afe13f3","head":{"label":"Lugdunum3D:feature-window-x11-2","ref":"feature-window-x11-2","sha":"f967db677ea780c10c964c4908dd1b796afe13f3","user":{"login":"Lugdunum3D","id":22453795,"avatar_url":"https://avatars.githubusercontent.com/u/22453795?v=3","gravatar_id":"","url":"https://api.github.com/users/Lugdunum3D","html_url":"https://github.com/Lugdunum3D","followers_url":"https://api.github.com/users/Lugdunum3D/followers","following_url":"https://api.github.com/users/Lugdunum3D/following{/other_user}","gists_url":"https://api.github.com/users/Lugdunum3D/gists{/gist_id}","starred_url":"https://api.github.com/users/Lugdunum3D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lugdunum3D/subscriptions","organizations_url":"https://api.github.com/users/Lugdunum3D/orgs","repos_url":"https://api.github.com/users/Lugdunum3D/repos","events_url":"https://api.github.com/users/Lugdunum3D/events{/privacy}","received_events_url":"https://api.github.com/users/Lugdunum3D/received_events","type":"Organization","site_admin":false},"repo":{"id":69289273,"name":"Lugdunum","full_name":"Lugdunum3D/Lugdunum","owner":{"login":"Lugdunum3D","id":22453795,"avatar_url":"https://avatars.githubusercontent.com/u/22453795?v=3","gravatar_id":"","url":"https://api.github.com/users/Lugdunum3D","html_url":"https://github.com/Lugdunum3D","followers_url":"https://api.github.com/users/Lugdunum3D/followers","following_url":"https://api.github.com/users/Lugdunum3D/following{/other_user}","gists_url":"https://api.github.com/users/Lugdunum3D/gists{/gist_id}","starred_url":"https://api.github.com/users/Lugdunum3D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lugdunum3D/subscriptions","organizations_url":"https://api.github.com/users/Lugdunum3D/orgs","repos_url":"https://api.github.com/users/Lugdunum3D/repos","events_url":"https://api.github.com/users/Lugdunum3D/events{/privacy}","received_events_url":"https://api.github.com/users/Lugdunum3D/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Lugdunum3D/Lugdunum","description":"A game engine think with Vulkan API in mind from scratch","fork":false,"url":"https://api.github.com/repos/Lugdunum3D/Lugdunum","forks_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/forks","keys_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/teams","hooks_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/hooks","issue_events_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/events{/number}","events_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/events","assignees_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/assignees{/user}","branches_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/branches{/branch}","tags_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/tags","blobs_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/statuses/{sha}","languages_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/languages","stargazers_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/stargazers","contributors_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/contributors","subscribers_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/subscribers","subscription_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/subscription","commits_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/contents/{+path}","compare_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/merges","archive_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/downloads","issues_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues{/number}","pulls_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls{/number}","milestones_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/milestones{/number}","notifications_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/labels{/name}","releases_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/releases{/id}","deployments_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/deployments","created_at":"2016-09-26T20:18:40Z","updated_at":"2016-10-27T22:13:22Z","pushed_at":"2016-11-19T21:10:08Z","git_url":"git://github.com/Lugdunum3D/Lugdunum.git","ssh_url":"git@github.com:Lugdunum3D/Lugdunum.git","clone_url":"https://github.com/Lugdunum3D/Lugdunum.git","svn_url":"https://github.com/Lugdunum3D/Lugdunum","homepage":null,"size":386,"stargazers_count":5,"watchers_count":5,"language":"CMake","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":5,"default_branch":"master"}},"base":{"label":"Lugdunum3D:feature-window","ref":"feature-window","sha":"94790472c965fe60dc3a79c057c3e2e7c2d70bc9","user":{"login":"Lugdunum3D","id":22453795,"avatar_url":"https://avatars.githubusercontent.com/u/22453795?v=3","gravatar_id":"","url":"https://api.github.com/users/Lugdunum3D","html_url":"https://github.com/Lugdunum3D","followers_url":"https://api.github.com/users/Lugdunum3D/followers","following_url":"https://api.github.com/users/Lugdunum3D/following{/other_user}","gists_url":"https://api.github.com/users/Lugdunum3D/gists{/gist_id}","starred_url":"https://api.github.com/users/Lugdunum3D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lugdunum3D/subscriptions","organizations_url":"https://api.github.com/users/Lugdunum3D/orgs","repos_url":"https://api.github.com/users/Lugdunum3D/repos","events_url":"https://api.github.com/users/Lugdunum3D/events{/privacy}","received_events_url":"https://api.github.com/users/Lugdunum3D/received_events","type":"Organization","site_admin":false},"repo":{"id":69289273,"name":"Lugdunum","full_name":"Lugdunum3D/Lugdunum","owner":{"login":"Lugdunum3D","id":22453795,"avatar_url":"https://avatars.githubusercontent.com/u/22453795?v=3","gravatar_id":"","url":"https://api.github.com/users/Lugdunum3D","html_url":"https://github.com/Lugdunum3D","followers_url":"https://api.github.com/users/Lugdunum3D/followers","following_url":"https://api.github.com/users/Lugdunum3D/following{/other_user}","gists_url":"https://api.github.com/users/Lugdunum3D/gists{/gist_id}","starred_url":"https://api.github.com/users/Lugdunum3D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Lugdunum3D/subscriptions","organizations_url":"https://api.github.com/users/Lugdunum3D/orgs","repos_url":"https://api.github.com/users/Lugdunum3D/repos","events_url":"https://api.github.com/users/Lugdunum3D/events{/privacy}","received_events_url":"https://api.github.com/users/Lugdunum3D/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/Lugdunum3D/Lugdunum","description":"A game engine think with Vulkan API in mind from scratch","fork":false,"url":"https://api.github.com/repos/Lugdunum3D/Lugdunum","forks_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/forks","keys_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/teams","hooks_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/hooks","issue_events_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/events{/number}","events_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/events","assignees_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/assignees{/user}","branches_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/branches{/branch}","tags_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/tags","blobs_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/refs{/sha}","trees_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/statuses/{sha}","languages_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/languages","stargazers_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/stargazers","contributors_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/contributors","subscribers_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/subscribers","subscription_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/subscription","commits_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/commits{/sha}","git_commits_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/git/commits{/sha}","comments_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/comments{/number}","issue_comment_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/comments{/number}","contents_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/contents/{+path}","compare_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/merges","archive_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/downloads","issues_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues{/number}","pulls_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls{/number}","milestones_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/milestones{/number}","notifications_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/labels{/name}","releases_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/releases{/id}","deployments_url":"https://api.github.com/repos/Lugdunum3D/Lugdunum/deployments","created_at":"2016-09-26T20:18:40Z","updated_at":"2016-10-27T22:13:22Z","pushed_at":"2016-11-19T21:10:08Z","git_url":"git://github.com/Lugdunum3D/Lugdunum.git","ssh_url":"git@github.com:Lugdunum3D/Lugdunum.git","clone_url":"https://github.com/Lugdunum3D/Lugdunum.git","svn_url":"https://github.com/Lugdunum3D/Lugdunum","homepage":null,"size":386,"stargazers_count":5,"watchers_count":5,"language":"CMake","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":5,"forks":0,"open_issues":5,"watchers":5,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15"},"html":{"href":"https://github.com/Lugdunum3D/Lugdunum/pull/15"},"issue":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/15"},"comments":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/issues/15/comments"},"review_comments":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15/comments"},"review_comment":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/pulls/15/commits"},"statuses":{"href":"https://api.github.com/repos/Lugdunum3D/Lugdunum/statuses/f967db677ea780c10c964c4908dd1b796afe13f3"}}}}
{"actor":{"display_login":"Quentin01"}}