GitHub PullRequestReviewCommentEvent at 2014-10-23 19:34:28
Repository: vispy
Actor: lcampagn
Payload: {"action":"created","comment":{"url":"https://api.github.com/repos/vispy/vispy/pulls/comments/19301867","id":19301867,"diff_hunk":"@@ -180,10 +180,12 @@ def _vispy_mouse_release(self, **kwds):\n         # default method for delivering mouse release events to the canvas\n         kwds.update(self._vispy_mouse_data)\n         ev = self._vispy_canvas.events.mouse_release(**kwds)\n-        if ev.button == self._vispy_mouse_data['press_event'].button:\n-            self._vispy_mouse_data['press_event'] = None\n-\n-        self._vispy_mouse_data['buttons'].remove(ev.button)\n+        if ev is None:\n+            return\n+        self._vispy_mouse_data['press_event'] = None\n+        # TODO: this is a bit ugly, need to improve mouse button handling in app\n+        ev._button = None\n+        self._vispy_mouse_data['buttons'] = []","path":"vispy/app/base.py","position":13,"original_position":13,"commit_id":"860ecd3608fe2e6a1b45652b671c6ff4d9b3e074","original_commit_id":"860ecd3608fe2e6a1b45652b671c6ff4d9b3e074","user":{"login":"lcampagn","id":940580,"avatar_url":"https://avatars.githubusercontent.com/u/940580?v=2","gravatar_id":"","url":"https://api.github.com/users/lcampagn","html_url":"https://github.com/lcampagn","followers_url":"https://api.github.com/users/lcampagn/followers","following_url":"https://api.github.com/users/lcampagn/following{/other_user}","gists_url":"https://api.github.com/users/lcampagn/gists{/gist_id}","starred_url":"https://api.github.com/users/lcampagn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lcampagn/subscriptions","organizations_url":"https://api.github.com/users/lcampagn/orgs","repos_url":"https://api.github.com/users/lcampagn/repos","events_url":"https://api.github.com/users/lcampagn/events{/privacy}","received_events_url":"https://api.github.com/users/lcampagn/received_events","type":"User","site_admin":false},"body":"We definitely need a way to ask \"which mouse buttons are pressed right now\". If the user can press two buttons at once, somebody will want to take advantage of that. Example: in many applications, you can drag with the left mouse button and then click with the right to cancel the drag operation.\r\n\r\nI'd be ok with changing the name `buttons` to something less ambiguous.. ","created_at":"2014-10-23T19:34:28Z","updated_at":"2014-10-23T19:34:28Z","html_url":"https://github.com/vispy/vispy/pull/592#discussion_r19301867","pull_request_url":"https://api.github.com/repos/vispy/vispy/pulls/592","_links":{"self":{"href":"https://api.github.com/repos/vispy/vispy/pulls/comments/19301867"},"html":{"href":"https://github.com/vispy/vispy/pull/592#discussion_r19301867"},"pull_request":{"href":"https://api.github.com/repos/vispy/vispy/pulls/592"}}},"pull_request":{"url":"https://api.github.com/repos/vispy/vispy/pulls/592","id":22887922,"html_url":"https://github.com/vispy/vispy/pull/592","diff_url":"https://github.com/vispy/vispy/pull/592.diff","patch_url":"https://github.com/vispy/vispy/pull/592.patch","issue_url":"https://api.github.com/repos/vispy/vispy/issues/592","number":592,"state":"open","locked":false,"title":"WebGL backend","user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=2","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"body":"This PR implements an online WebGL backend on the IPython notebook.\r\n\r\nMost of the JavaScript code is [there](https://github.com/vispy/vispy.js), and minified here (`vispy.min.js`).\r\n\r\n### Event loop\r\n\r\nI think I have figured out the best way to implement the event loop in the notebook. Everything is triggered from JavaScript exclusively. The reason is that regular WebGL applications have to implement `requestAnimationFrame()` for the event loop. Here is how it works:\r\n\r\n* This JS callback function is called at a framerate depending on the screen refresh rate (this is handled by the browser). If the window is hidden or minified, the loop stops automatically (the browser does everything for us).\r\n* When the user moves the mouse and do things in the canvas, events are saved in a JS queue.\r\n* The event loop processes the queue, sends all events to Python, and clears the queue.\r\n* When Python receives the events, it processes them through Vispy, and a list of GLIR commands is generated and sent back to the browser. These events are pushed into a GLIR queue in JS.\r\n* In the JS event loop, if the GLIR queue is not empty, the events are processed by the WebGL backend.\r\n\r\nThis architecture unifies timer-based and event-based visualizations. It is efficient because the browser takes care of everything. If nothing happens (no mouse event) and if there's no timer, nothing happens in Python and JS, so we don't waste CPU cycles for nothing.\r\n\r\n### TODO list\r\n\r\n* [x] find out how to deal with a context and the GLIR queue\r\n* [x] make the backend work\r\n* [x] make resizing work\r\n* [x] implement mat types for uniforms\r\n* [ ] test all examples\r\n* [ ] implement framebuffers in the WebGL backend\r\n* ~~put back the `ipynb_png` backend (I had to remove the  ̀vispy.js` file) (in another PR)~~\r\n","created_at":"2014-10-16T21:24:07Z","updated_at":"2014-10-23T19:34:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"eb378b8de2b00527e1902dc3a9f7570f1e3ae8f0","assignee":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=2","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/vispy/vispy/pulls/592/commits","review_comments_url":"https://api.github.com/repos/vispy/vispy/pulls/592/comments","review_comment_url":"https://api.github.com/repos/vispy/vispy/pulls/comments/{number}","comments_url":"https://api.github.com/repos/vispy/vispy/issues/592/comments","statuses_url":"https://api.github.com/repos/vispy/vispy/statuses/860ecd3608fe2e6a1b45652b671c6ff4d9b3e074","head":{"label":"rossant:webgl-backend","ref":"webgl-backend","sha":"860ecd3608fe2e6a1b45652b671c6ff4d9b3e074","user":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=2","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"repo":{"id":20727406,"name":"vispy","full_name":"rossant/vispy","owner":{"login":"rossant","id":1942359,"avatar_url":"https://avatars.githubusercontent.com/u/1942359?v=2","gravatar_id":"","url":"https://api.github.com/users/rossant","html_url":"https://github.com/rossant","followers_url":"https://api.github.com/users/rossant/followers","following_url":"https://api.github.com/users/rossant/following{/other_user}","gists_url":"https://api.github.com/users/rossant/gists{/gist_id}","starred_url":"https://api.github.com/users/rossant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rossant/subscriptions","organizations_url":"https://api.github.com/users/rossant/orgs","repos_url":"https://api.github.com/users/rossant/repos","events_url":"https://api.github.com/users/rossant/events{/privacy}","received_events_url":"https://api.github.com/users/rossant/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rossant/vispy","description":"Main repository for Vispy","fork":true,"url":"https://api.github.com/repos/rossant/vispy","forks_url":"https://api.github.com/repos/rossant/vispy/forks","keys_url":"https://api.github.com/repos/rossant/vispy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rossant/vispy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rossant/vispy/teams","hooks_url":"https://api.github.com/repos/rossant/vispy/hooks","issue_events_url":"https://api.github.com/repos/rossant/vispy/issues/events{/number}","events_url":"https://api.github.com/repos/rossant/vispy/events","assignees_url":"https://api.github.com/repos/rossant/vispy/assignees{/user}","branches_url":"https://api.github.com/repos/rossant/vispy/branches{/branch}","tags_url":"https://api.github.com/repos/rossant/vispy/tags","blobs_url":"https://api.github.com/repos/rossant/vispy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rossant/vispy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rossant/vispy/git/refs{/sha}","trees_url":"https://api.github.com/repos/rossant/vispy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rossant/vispy/statuses/{sha}","languages_url":"https://api.github.com/repos/rossant/vispy/languages","stargazers_url":"https://api.github.com/repos/rossant/vispy/stargazers","contributors_url":"https://api.github.com/repos/rossant/vispy/contributors","subscribers_url":"https://api.github.com/repos/rossant/vispy/subscribers","subscription_url":"https://api.github.com/repos/rossant/vispy/subscription","commits_url":"https://api.github.com/repos/rossant/vispy/commits{/sha}","git_commits_url":"https://api.github.com/repos/rossant/vispy/git/commits{/sha}","comments_url":"https://api.github.com/repos/rossant/vispy/comments{/number}","issue_comment_url":"https://api.github.com/repos/rossant/vispy/issues/comments/{number}","contents_url":"https://api.github.com/repos/rossant/vispy/contents/{+path}","compare_url":"https://api.github.com/repos/rossant/vispy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rossant/vispy/merges","archive_url":"https://api.github.com/repos/rossant/vispy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rossant/vispy/downloads","issues_url":"https://api.github.com/repos/rossant/vispy/issues{/number}","pulls_url":"https://api.github.com/repos/rossant/vispy/pulls{/number}","milestones_url":"https://api.github.com/repos/rossant/vispy/milestones{/number}","notifications_url":"https://api.github.com/repos/rossant/vispy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rossant/vispy/labels{/name}","releases_url":"https://api.github.com/repos/rossant/vispy/releases{/id}","created_at":"2014-06-11T14:07:00Z","updated_at":"2014-07-24T18:33:34Z","pushed_at":"2014-10-22T17:24:05Z","git_url":"git://github.com/rossant/vispy.git","ssh_url":"git@github.com:rossant/vispy.git","clone_url":"https://github.com/rossant/vispy.git","svn_url":"https://github.com/rossant/vispy","homepage":"","size":6917,"stargazers_count":1,"watchers_count":1,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":1,"default_branch":"master"}},"base":{"label":"vispy:master","ref":"master","sha":"07dadee3aefd08402feb18958b781b28d794a268","user":{"login":"vispy","id":3934254,"avatar_url":"https://avatars.githubusercontent.com/u/3934254?v=2","gravatar_id":"","url":"https://api.github.com/users/vispy","html_url":"https://github.com/vispy","followers_url":"https://api.github.com/users/vispy/followers","following_url":"https://api.github.com/users/vispy/following{/other_user}","gists_url":"https://api.github.com/users/vispy/gists{/gist_id}","starred_url":"https://api.github.com/users/vispy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vispy/subscriptions","organizations_url":"https://api.github.com/users/vispy/orgs","repos_url":"https://api.github.com/users/vispy/repos","events_url":"https://api.github.com/users/vispy/events{/privacy}","received_events_url":"https://api.github.com/users/vispy/received_events","type":"Organization","site_admin":false},"repo":{"id":8935948,"name":"vispy","full_name":"vispy/vispy","owner":{"login":"vispy","id":3934254,"avatar_url":"https://avatars.githubusercontent.com/u/3934254?v=2","gravatar_id":"","url":"https://api.github.com/users/vispy","html_url":"https://github.com/vispy","followers_url":"https://api.github.com/users/vispy/followers","following_url":"https://api.github.com/users/vispy/following{/other_user}","gists_url":"https://api.github.com/users/vispy/gists{/gist_id}","starred_url":"https://api.github.com/users/vispy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vispy/subscriptions","organizations_url":"https://api.github.com/users/vispy/orgs","repos_url":"https://api.github.com/users/vispy/repos","events_url":"https://api.github.com/users/vispy/events{/privacy}","received_events_url":"https://api.github.com/users/vispy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/vispy/vispy","description":"Main repository for Vispy","fork":false,"url":"https://api.github.com/repos/vispy/vispy","forks_url":"https://api.github.com/repos/vispy/vispy/forks","keys_url":"https://api.github.com/repos/vispy/vispy/keys{/key_id}","collaborators_url":"https://api.github.com/repos/vispy/vispy/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/vispy/vispy/teams","hooks_url":"https://api.github.com/repos/vispy/vispy/hooks","issue_events_url":"https://api.github.com/repos/vispy/vispy/issues/events{/number}","events_url":"https://api.github.com/repos/vispy/vispy/events","assignees_url":"https://api.github.com/repos/vispy/vispy/assignees{/user}","branches_url":"https://api.github.com/repos/vispy/vispy/branches{/branch}","tags_url":"https://api.github.com/repos/vispy/vispy/tags","blobs_url":"https://api.github.com/repos/vispy/vispy/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/vispy/vispy/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/vispy/vispy/git/refs{/sha}","trees_url":"https://api.github.com/repos/vispy/vispy/git/trees{/sha}","statuses_url":"https://api.github.com/repos/vispy/vispy/statuses/{sha}","languages_url":"https://api.github.com/repos/vispy/vispy/languages","stargazers_url":"https://api.github.com/repos/vispy/vispy/stargazers","contributors_url":"https://api.github.com/repos/vispy/vispy/contributors","subscribers_url":"https://api.github.com/repos/vispy/vispy/subscribers","subscription_url":"https://api.github.com/repos/vispy/vispy/subscription","commits_url":"https://api.github.com/repos/vispy/vispy/commits{/sha}","git_commits_url":"https://api.github.com/repos/vispy/vispy/git/commits{/sha}","comments_url":"https://api.github.com/repos/vispy/vispy/comments{/number}","issue_comment_url":"https://api.github.com/repos/vispy/vispy/issues/comments/{number}","contents_url":"https://api.github.com/repos/vispy/vispy/contents/{+path}","compare_url":"https://api.github.com/repos/vispy/vispy/compare/{base}...{head}","merges_url":"https://api.github.com/repos/vispy/vispy/merges","archive_url":"https://api.github.com/repos/vispy/vispy/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/vispy/vispy/downloads","issues_url":"https://api.github.com/repos/vispy/vispy/issues{/number}","pulls_url":"https://api.github.com/repos/vispy/vispy/pulls{/number}","milestones_url":"https://api.github.com/repos/vispy/vispy/milestones{/number}","notifications_url":"https://api.github.com/repos/vispy/vispy/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/vispy/vispy/labels{/name}","releases_url":"https://api.github.com/repos/vispy/vispy/releases{/id}","created_at":"2013-03-21T18:43:22Z","updated_at":"2014-10-22T11:20:28Z","pushed_at":"2014-10-21T23:16:22Z","git_url":"git://github.com/vispy/vispy.git","ssh_url":"git@github.com:vispy/vispy.git","clone_url":"https://github.com/vispy/vispy.git","svn_url":"https://github.com/vispy/vispy","homepage":"http://vispy.org","size":24155,"stargazers_count":409,"watchers_count":409,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":50,"mirror_url":null,"open_issues_count":122,"forks":50,"open_issues":122,"watchers":409,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/vispy/vispy/pulls/592"},"html":{"href":"https://github.com/vispy/vispy/pull/592"},"issue":{"href":"https://api.github.com/repos/vispy/vispy/issues/592"},"comments":{"href":"https://api.github.com/repos/vispy/vispy/issues/592/comments"},"review_comments":{"href":"https://api.github.com/repos/vispy/vispy/pulls/592/comments"},"review_comment":{"href":"https://api.github.com/repos/vispy/vispy/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/vispy/vispy/pulls/592/commits"},"statuses":{"href":"https://api.github.com/repos/vispy/vispy/statuses/860ecd3608fe2e6a1b45652b671c6ff4d9b3e074"}}}}