{"action":"created","comment":{"url":"https://api.github.com/repos/swaywm/wlroots/pulls/comments/175296575","pull_request_review_id":104804652,"id":175296575,"diff_hunk":"@@ -0,0 +1,102 @@\n+#ifndef WLR_TYPES_WLR_LAYER_SHELL_H\n+#define WLR_TYPES_WLR_LAYER_SHELL_H\n+#include <stdbool.h>\n+#include <stdint.h>\n+#include <wayland-server.h>\n+#include <wlr/types/wlr_box.h>\n+#include <wlr/types/wlr_surface.h>\n+#include \"wlr-layer-shell-unstable-v1-protocol.h\"\n+\n+/**\n+ * wlr_layer_shell allows clients to arrange themselves in \"layers\" on the\n+ * desktop in accordance with the wlr-layer-shell protocol. When a client is\n+ * added, the new_surface signal will be raised and passed a reference to our\n+ * wlr_layer_surface. At this time, the client will have configured the surface\n+ * as it desires, including information like desired anchors and margins. The\n+ * compositor should use this information to decide how to arrange the layer\n+ * on-screen, then determine the dimensions of the layer and call\n+ * wlr_layer_surface_configure. The client will then attach a buffer and commit\n+ * the surface, at which point the wlr_layer_surface map signal is raised and\n+ * the compositor should begin rendering the surface.\n+ */\n+struct wlr_layer_shell {\n+\tstruct wl_global *wl_global;\n+\tstruct wl_list clients;\n+\n+\tstruct wl_listener display_destroy;\n+\n+\tstruct {\n+\t\tstruct wl_signal new_surface;\n+\t} events;\n+\n+\tvoid *data;\n+};\n+\n+struct wlr_layer_client {\n+\tstruct wlr_layer_shell *shell;\n+\tstruct wl_resource *resource;\n+\tstruct wl_client *client;\n+\tstruct wl_list surfaces;\n+\n+\tstruct wl_list link; // wlr_layer_shell::clients\n+};\n+\n+struct wlr_layer_surface_state {\n+\t// Client\n+\tuint32_t anchor;\n+\tuint32_t exclusive_zone;\n+\tstruct {\n+\t\tuint32_t top, right, bottom, left;\n+\t} margin;\n+\t// Server\n+\tuint32_t width, height;\n+};\n+\n+struct wlr_layer_surface_configure {\n+\tstruct wl_list link; // wlr_layer_surface::configure_list\n+\tuint32_t serial;\n+\tstruct wlr_layer_surface_state state;\n+};\n+\n+struct wlr_layer_surface {\n+\tstruct wlr_surface *surface;\n+\tstruct wlr_layer_client *client;\n+\tstruct wl_resource *resource;\n+\tstruct wl_list link; // wlr_layer_client:surfaces\n+\n+\tconst char *namespace;\n+\tenum zwlr_layer_shell_v1_layer layer;\n+\n+\tbool added, configured, mapped;\n+\tuint32_t configure_serial;\n+\tstruct wl_event_source *configure_idle;\n+\tuint32_t configure_next_serial;\n+\tstruct wl_list configure_list;\n+\n+\tstruct wlr_layer_surface_state next; // client protocol requests\n+\tstruct wlr_layer_surface_state pending; // our configure requests\n+\tstruct wlr_layer_surface_state current;\n+\n+\tstruct wl_listener surface_destroy_listener;\n+\n+\tstruct {\n+\t\tstruct wl_signal destroy;\n+\t\tstruct wl_signal map;\n+\t\tstruct wl_signal unmap;\n+\t} events;\n+\n+\tvoid *data;\n+};\n+\n+struct wlr_layer_shell *wlr_layer_shell_create(struct wl_display *display);\n+void wlr_layer_shell_destroy(struct wlr_layer_shell *layer_shell);\n+\n+/**\n+ * Notifies the layer surface to configure itself with this width/height. The\n+ * layer_surface will signal its map event when the surface is ready to assume\n+ * this size.\n+ */","path":"include/wlr/types/wlr_layer_shell.h","position":98,"original_position":98,"commit_id":"193a7704507dcad83fcedbea98e156e07878c202","original_commit_id":"193a7704507dcad83fcedbea98e156e07878c202","user":{"login":"emersion","id":506932,"avatar_url":"https://avatars1.githubusercontent.com/u/506932?v=4","gravatar_id":"","url":"https://api.github.com/users/emersion","html_url":"https://github.com/emersion","followers_url":"https://api.github.com/users/emersion/followers","following_url":"https://api.github.com/users/emersion/following{/other_user}","gists_url":"https://api.github.com/users/emersion/gists{/gist_id}","starred_url":"https://api.github.com/users/emersion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/emersion/subscriptions","organizations_url":"https://api.github.com/users/emersion/orgs","repos_url":"https://api.github.com/users/emersion/repos","events_url":"https://api.github.com/users/emersion/events{/privacy}","received_events_url":"https://api.github.com/users/emersion/received_events","type":"User","site_admin":false},"body":"I don't think this should happen automatically. If the compositor always draws a bar at the top on its own or implements another similar protocol, it may want to choose a different size given other constraints. We can provide default helpers though.","created_at":"2018-03-18T17:31:09Z","updated_at":"2018-03-18T17:31:10Z","html_url":"https://github.com/swaywm/wlroots/pull/731#discussion_r175296575","pull_request_url":"https://api.github.com/repos/swaywm/wlroots/pulls/731","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/swaywm/wlroots/pulls/comments/175296575"},"html":{"href":"https://github.com/swaywm/wlroots/pull/731#discussion_r175296575"},"pull_request":{"href":"https://api.github.com/repos/swaywm/wlroots/pulls/731"}},"in_reply_to_id":175295254},"pull_request":{"url":"https://api.github.com/repos/swaywm/wlroots/pulls/731","id":175729840,"html_url":"https://github.com/swaywm/wlroots/pull/731","diff_url":"https://github.com/swaywm/wlroots/pull/731.diff","patch_url":"https://github.com/swaywm/wlroots/pull/731.patch","issue_url":"https://api.github.com/repos/swaywm/wlroots/issues/731","number":731,"state":"open","locked":false,"title":"[WIP] Implement wlr-layer-shell protocol","user":{"login":"SirCmpwn","id":1310872,"avatar_url":"https://avatars0.githubusercontent.com/u/1310872?v=4","gravatar_id":"","url":"https://api.github.com/users/SirCmpwn","html_url":"https://github.com/SirCmpwn","followers_url":"https://api.github.com/users/SirCmpwn/followers","following_url":"https://api.github.com/users/SirCmpwn/following{/other_user}","gists_url":"https://api.github.com/users/SirCmpwn/gists{/gist_id}","starred_url":"https://api.github.com/users/SirCmpwn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/SirCmpwn/subscriptions","organizations_url":"https://api.github.com/users/SirCmpwn/orgs","repos_url":"https://api.github.com/users/SirCmpwn/repos","events_url":"https://api.github.com/users/SirCmpwn/events{/privacy}","received_events_url":"https://api.github.com/users/SirCmpwn/received_events","type":"User","site_admin":false},"body":"Implements the protocol extension described in https://github.com/swaywm/wlr-protocols/pull/7\r\n\r\n- [ ] wlroots implementation\r\n  - [x] configure\r\n  - [ ] get_popup\r\n  - [ ] get_input\r\n- [ ] rootston implementation\r\n  - [ ] rendering\r\n  - [ ] input\r\n  - [ ] popups\r\n- [ ] test client\r\n  - [ ] basics\r\n  - [ ] input\r\n  - [ ] popups","created_at":"2018-03-18T01:16:16Z","updated_at":"2018-03-18T17:31:10Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c81744857d9c75394a49bcb245e3a4e6d9420601","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/swaywm/wlroots/pulls/731/commits","review_comments_url":"https://api.github.com/repos/swaywm/wlroots/pulls/731/comments","review_comment_url":"https://api.github.com/repos/swaywm/wlroots/pulls/comments{/number}","comments_url":"https://api.github.com/repos/swaywm/wlroots/issues/731/comments","statuses_url":"https://api.github.com/repos/swaywm/wlroots/statuses/193a7704507dcad83fcedbea98e156e07878c202","head":{"label":"swaywm:layer-surfaces","ref":"layer-surfaces","sha":"193a7704507dcad83fcedbea98e156e07878c202","user":{"login":"swaywm","id":32400794,"avatar_url":"https://avatars1.githubusercontent.com/u/32400794?v=4","gravatar_id":"","url":"https://api.github.com/users/swaywm","html_url":"https://github.com/swaywm","followers_url":"https://api.github.com/users/swaywm/followers","following_url":"https://api.github.com/users/swaywm/following{/other_user}","gists_url":"https://api.github.com/users/swaywm/gists{/gist_id}","starred_url":"https://api.github.com/users/swaywm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaywm/subscriptions","organizations_url":"https://api.github.com/users/swaywm/orgs","repos_url":"https://api.github.com/users/swaywm/repos","events_url":"https://api.github.com/users/swaywm/events{/privacy}","received_events_url":"https://api.github.com/users/swaywm/received_events","type":"Organization","site_admin":false},"repo":{"id":89377392,"name":"wlroots","full_name":"swaywm/wlroots","owner":{"login":"swaywm","id":32400794,"avatar_url":"https://avatars1.githubusercontent.com/u/32400794?v=4","gravatar_id":"","url":"https://api.github.com/users/swaywm","html_url":"https://github.com/swaywm","followers_url":"https://api.github.com/users/swaywm/followers","following_url":"https://api.github.com/users/swaywm/following{/other_user}","gists_url":"https://api.github.com/users/swaywm/gists{/gist_id}","starred_url":"https://api.github.com/users/swaywm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaywm/subscriptions","organizations_url":"https://api.github.com/users/swaywm/orgs","repos_url":"https://api.github.com/users/swaywm/repos","events_url":"https://api.github.com/users/swaywm/events{/privacy}","received_events_url":"https://api.github.com/users/swaywm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swaywm/wlroots","description":"A modular Wayland compositor library","fork":false,"url":"https://api.github.com/repos/swaywm/wlroots","forks_url":"https://api.github.com/repos/swaywm/wlroots/forks","keys_url":"https://api.github.com/repos/swaywm/wlroots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swaywm/wlroots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swaywm/wlroots/teams","hooks_url":"https://api.github.com/repos/swaywm/wlroots/hooks","issue_events_url":"https://api.github.com/repos/swaywm/wlroots/issues/events{/number}","events_url":"https://api.github.com/repos/swaywm/wlroots/events","assignees_url":"https://api.github.com/repos/swaywm/wlroots/assignees{/user}","branches_url":"https://api.github.com/repos/swaywm/wlroots/branches{/branch}","tags_url":"https://api.github.com/repos/swaywm/wlroots/tags","blobs_url":"https://api.github.com/repos/swaywm/wlroots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swaywm/wlroots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swaywm/wlroots/git/refs{/sha}","trees_url":"https://api.github.com/repos/swaywm/wlroots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swaywm/wlroots/statuses/{sha}","languages_url":"https://api.github.com/repos/swaywm/wlroots/languages","stargazers_url":"https://api.github.com/repos/swaywm/wlroots/stargazers","contributors_url":"https://api.github.com/repos/swaywm/wlroots/contributors","subscribers_url":"https://api.github.com/repos/swaywm/wlroots/subscribers","subscription_url":"https://api.github.com/repos/swaywm/wlroots/subscription","commits_url":"https://api.github.com/repos/swaywm/wlroots/commits{/sha}","git_commits_url":"https://api.github.com/repos/swaywm/wlroots/git/commits{/sha}","comments_url":"https://api.github.com/repos/swaywm/wlroots/comments{/number}","issue_comment_url":"https://api.github.com/repos/swaywm/wlroots/issues/comments{/number}","contents_url":"https://api.github.com/repos/swaywm/wlroots/contents/{+path}","compare_url":"https://api.github.com/repos/swaywm/wlroots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swaywm/wlroots/merges","archive_url":"https://api.github.com/repos/swaywm/wlroots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swaywm/wlroots/downloads","issues_url":"https://api.github.com/repos/swaywm/wlroots/issues{/number}","pulls_url":"https://api.github.com/repos/swaywm/wlroots/pulls{/number}","milestones_url":"https://api.github.com/repos/swaywm/wlroots/milestones{/number}","notifications_url":"https://api.github.com/repos/swaywm/wlroots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swaywm/wlroots/labels{/name}","releases_url":"https://api.github.com/repos/swaywm/wlroots/releases{/id}","deployments_url":"https://api.github.com/repos/swaywm/wlroots/deployments","created_at":"2017-04-25T15:33:43Z","updated_at":"2018-03-18T08:25:36Z","pushed_at":"2018-03-18T10:39:19Z","git_url":"git://github.com/swaywm/wlroots.git","ssh_url":"git@github.com:swaywm/wlroots.git","clone_url":"https://github.com/swaywm/wlroots.git","svn_url":"https://github.com/swaywm/wlroots","homepage":"http://swaywm.org","size":3440,"stargazers_count":294,"watchers_count":294,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":84,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":49,"open_issues":84,"watchers":294,"default_branch":"master"}},"base":{"label":"swaywm:master","ref":"master","sha":"1956d3cedb533fb44a7f6a446afe84572838ca39","user":{"login":"swaywm","id":32400794,"avatar_url":"https://avatars1.githubusercontent.com/u/32400794?v=4","gravatar_id":"","url":"https://api.github.com/users/swaywm","html_url":"https://github.com/swaywm","followers_url":"https://api.github.com/users/swaywm/followers","following_url":"https://api.github.com/users/swaywm/following{/other_user}","gists_url":"https://api.github.com/users/swaywm/gists{/gist_id}","starred_url":"https://api.github.com/users/swaywm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaywm/subscriptions","organizations_url":"https://api.github.com/users/swaywm/orgs","repos_url":"https://api.github.com/users/swaywm/repos","events_url":"https://api.github.com/users/swaywm/events{/privacy}","received_events_url":"https://api.github.com/users/swaywm/received_events","type":"Organization","site_admin":false},"repo":{"id":89377392,"name":"wlroots","full_name":"swaywm/wlroots","owner":{"login":"swaywm","id":32400794,"avatar_url":"https://avatars1.githubusercontent.com/u/32400794?v=4","gravatar_id":"","url":"https://api.github.com/users/swaywm","html_url":"https://github.com/swaywm","followers_url":"https://api.github.com/users/swaywm/followers","following_url":"https://api.github.com/users/swaywm/following{/other_user}","gists_url":"https://api.github.com/users/swaywm/gists{/gist_id}","starred_url":"https://api.github.com/users/swaywm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swaywm/subscriptions","organizations_url":"https://api.github.com/users/swaywm/orgs","repos_url":"https://api.github.com/users/swaywm/repos","events_url":"https://api.github.com/users/swaywm/events{/privacy}","received_events_url":"https://api.github.com/users/swaywm/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/swaywm/wlroots","description":"A modular Wayland compositor library","fork":false,"url":"https://api.github.com/repos/swaywm/wlroots","forks_url":"https://api.github.com/repos/swaywm/wlroots/forks","keys_url":"https://api.github.com/repos/swaywm/wlroots/keys{/key_id}","collaborators_url":"https://api.github.com/repos/swaywm/wlroots/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/swaywm/wlroots/teams","hooks_url":"https://api.github.com/repos/swaywm/wlroots/hooks","issue_events_url":"https://api.github.com/repos/swaywm/wlroots/issues/events{/number}","events_url":"https://api.github.com/repos/swaywm/wlroots/events","assignees_url":"https://api.github.com/repos/swaywm/wlroots/assignees{/user}","branches_url":"https://api.github.com/repos/swaywm/wlroots/branches{/branch}","tags_url":"https://api.github.com/repos/swaywm/wlroots/tags","blobs_url":"https://api.github.com/repos/swaywm/wlroots/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/swaywm/wlroots/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/swaywm/wlroots/git/refs{/sha}","trees_url":"https://api.github.com/repos/swaywm/wlroots/git/trees{/sha}","statuses_url":"https://api.github.com/repos/swaywm/wlroots/statuses/{sha}","languages_url":"https://api.github.com/repos/swaywm/wlroots/languages","stargazers_url":"https://api.github.com/repos/swaywm/wlroots/stargazers","contributors_url":"https://api.github.com/repos/swaywm/wlroots/contributors","subscribers_url":"https://api.github.com/repos/swaywm/wlroots/subscribers","subscription_url":"https://api.github.com/repos/swaywm/wlroots/subscription","commits_url":"https://api.github.com/repos/swaywm/wlroots/commits{/sha}","git_commits_url":"https://api.github.com/repos/swaywm/wlroots/git/commits{/sha}","comments_url":"https://api.github.com/repos/swaywm/wlroots/comments{/number}","issue_comment_url":"https://api.github.com/repos/swaywm/wlroots/issues/comments{/number}","contents_url":"https://api.github.com/repos/swaywm/wlroots/contents/{+path}","compare_url":"https://api.github.com/repos/swaywm/wlroots/compare/{base}...{head}","merges_url":"https://api.github.com/repos/swaywm/wlroots/merges","archive_url":"https://api.github.com/repos/swaywm/wlroots/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/swaywm/wlroots/downloads","issues_url":"https://api.github.com/repos/swaywm/wlroots/issues{/number}","pulls_url":"https://api.github.com/repos/swaywm/wlroots/pulls{/number}","milestones_url":"https://api.github.com/repos/swaywm/wlroots/milestones{/number}","notifications_url":"https://api.github.com/repos/swaywm/wlroots/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/swaywm/wlroots/labels{/name}","releases_url":"https://api.github.com/repos/swaywm/wlroots/releases{/id}","deployments_url":"https://api.github.com/repos/swaywm/wlroots/deployments","created_at":"2017-04-25T15:33:43Z","updated_at":"2018-03-18T08:25:36Z","pushed_at":"2018-03-18T10:39:19Z","git_url":"git://github.com/swaywm/wlroots.git","ssh_url":"git@github.com:swaywm/wlroots.git","clone_url":"https://github.com/swaywm/wlroots.git","svn_url":"https://github.com/swaywm/wlroots","homepage":"http://swaywm.org","size":3440,"stargazers_count":294,"watchers_count":294,"language":"C","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":49,"mirror_url":null,"archived":false,"open_issues_count":84,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit"},"forks":49,"open_issues":84,"watchers":294,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/swaywm/wlroots/pulls/731"},"html":{"href":"https://github.com/swaywm/wlroots/pull/731"},"issue":{"href":"https://api.github.com/repos/swaywm/wlroots/issues/731"},"comments":{"href":"https://api.github.com/repos/swaywm/wlroots/issues/731/comments"},"review_comments":{"href":"https://api.github.com/repos/swaywm/wlroots/pulls/731/comments"},"review_comment":{"href":"https://api.github.com/repos/swaywm/wlroots/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/swaywm/wlroots/pulls/731/commits"},"statuses":{"href":"https://api.github.com/repos/swaywm/wlroots/statuses/193a7704507dcad83fcedbea98e156e07878c202"}},"author_association":"OWNER"}}
{"actor":{"display_login":"emersion"}}