{"action":"closed","number":2160,"pull_request":{"url":"https://api.github.com/repos/awesomeWM/awesome/pulls/2160","id":163773209,"html_url":"https://github.com/awesomeWM/awesome/pull/2160","diff_url":"https://github.com/awesomeWM/awesome/pull/2160.diff","patch_url":"https://github.com/awesomeWM/awesome/pull/2160.patch","issue_url":"https://api.github.com/repos/awesomeWM/awesome/issues/2160","number":2160,"state":"closed","locked":false,"title":"Use GdkPixbuf directly from Lua","user":{"login":"psychon","id":89482,"avatar_url":"https://avatars3.githubusercontent.com/u/89482?v=4","gravatar_id":"","url":"https://api.github.com/users/psychon","html_url":"https://github.com/psychon","followers_url":"https://api.github.com/users/psychon/followers","following_url":"https://api.github.com/users/psychon/following{/other_user}","gists_url":"https://api.github.com/users/psychon/gists{/gist_id}","starred_url":"https://api.github.com/users/psychon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychon/subscriptions","organizations_url":"https://api.github.com/users/psychon/orgs","repos_url":"https://api.github.com/users/psychon/repos","events_url":"https://api.github.com/users/psychon/events{/privacy}","received_events_url":"https://api.github.com/users/psychon/received_events","type":"User","site_admin":false},"body":"Note that this (likely) conflicts with #2123, so should only be merged after #2123.\r\n\r\nThe diffstat for this PR is:\r\n```\r\n 5 files changed, 33 insertions(+), 8 deletions(-)\r\n```\r\nHowever, the following patch has this diffstat\r\n```\r\n 3 files changed, 53 deletions(-)\r\n```\r\n```diff\r\ndiff --git a/draw.c b/draw.c\r\nindex 83d3d355..c3590b58 100644\r\n--- a/draw.c\r\n+++ b/draw.c\r\n@@ -171,27 +171,6 @@ draw_dup_image_surface(cairo_surface_t *surface)\r\n     return res;\r\n }\r\n \r\n-/** Load the specified path into a cairo surface\r\n- * \\param L Lua state\r\n- * \\param path file to load\r\n- * \\param error A place to store an error message, if needed\r\n- * \\return A cairo image surface or NULL on error.\r\n- */\r\n-cairo_surface_t *\r\n-draw_load_image(lua_State *L, const char *path, GError **error)\r\n-{\r\n-    cairo_surface_t *ret;\r\n-    GdkPixbuf *buf = gdk_pixbuf_new_from_file(path, error);\r\n-\r\n-    if (!buf)\r\n-        /* error was set above */\r\n-        return NULL;\r\n-\r\n-    ret = draw_surface_from_pixbuf(buf);\r\n-    g_object_unref(buf);\r\n-    return ret;\r\n-}\r\n-\r\n xcb_visualtype_t *draw_find_visual(const xcb_screen_t *s, xcb_visualid_t visual)\r\n {\r\n     xcb_depth_iterator_t depth_iter = xcb_screen_allowed_depths_iterator(s);\r\ndiff --git a/draw.h b/draw.h\r\nindex 867296cf..9adc36ff 100644\r\n--- a/draw.h\r\n+++ b/draw.h\r\n@@ -59,7 +59,6 @@ DO_ARRAY(cairo_surface_t *, cairo_surface, cairo_surface_array_destroy_surface)\r\n \r\n cairo_surface_t *draw_surface_from_data(int width, int height, uint32_t *data);\r\n cairo_surface_t *draw_dup_image_surface(cairo_surface_t *surface);\r\n-cairo_surface_t *draw_load_image(lua_State *L, const char *path, GError **error);\r\n cairo_surface_t *draw_surface_from_pixbuf(GdkPixbuf *buf);\r\n \r\n xcb_visualtype_t *draw_find_visual(const xcb_screen_t *s, xcb_visualid_t visual);\r\ndiff --git a/luaa.c b/luaa.c\r\nindex 29c7ec06..d143bcdb 100644\r\n--- a/luaa.c\r\n+++ b/luaa.c\r\n@@ -298,36 +298,6 @@ luaA_pixbuf_to_surface(lua_State *L)\r\n     return 1;\r\n }\r\n \r\n-/** Load an image from a given path.\r\n- *\r\n- * @param name The file name.\r\n- * @return[1] A cairo surface as light user datum.\r\n- * @return[2] nil\r\n- * @treturn[2] string Error message\r\n- * @function load_image\r\n- */\r\n-static int\r\n-luaA_load_image(lua_State *L)\r\n-{\r\n-    /* TODO: Deprecate this function, Lua can use GdkPixbuf directly plus\r\n-     * awesome.pixbuf_to_surface\r\n-     */\r\n-\r\n-    GError *error = NULL;\r\n-    const char *filename = luaL_checkstring(L, 1);\r\n-    cairo_surface_t *surface = draw_load_image(L, filename, &error);\r\n-    if (!surface) {\r\n-        lua_pushnil(L);\r\n-        lua_pushstring(L, error->message);\r\n-        g_error_free(error);\r\n-        return 2;\r\n-    }\r\n-\r\n-    /* lua has to make sure to free the ref or we have a leak */\r\n-    lua_pushlightuserdata(L, surface);\r\n-    return 1;\r\n-}\r\n-\r\n /** Set the preferred size for client icons.\r\n  *\r\n  * The closest equal or bigger size is picked if present, otherwise the closest\r\n@@ -796,7 +766,6 @@ luaA_init(xdgHandle* xdg, string_array_t *searchpath)\r\n         { \"disconnect_signal\", luaA_awesome_disconnect_signal },\r\n         { \"emit_signal\", luaA_awesome_emit_signal },\r\n         { \"systray\", luaA_systray },\r\n-        { \"load_image\", luaA_load_image },\r\n         { \"pixbuf_to_surface\", luaA_pixbuf_to_surface },\r\n         { \"set_preferred_icon_size\", luaA_set_preferred_icon_size },\r\n         { \"register_xproperty\", luaA_register_xproperty },\r\n\r\n```\r\nSo if one day we get rid of `load_image`, then this actually saves lines. ;-)","created_at":"2018-01-18T17:24:03Z","updated_at":"2018-02-17T12:27:21Z","closed_at":"2018-02-17T12:27:21Z","merged_at":"2018-02-17T12:27:21Z","merge_commit_sha":"ee944f4da8342187c2244edb01b90c54567129c4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":{"url":"https://api.github.com/repos/awesomeWM/awesome/milestones/1","html_url":"https://github.com/awesomeWM/awesome/milestone/1","labels_url":"https://api.github.com/repos/awesomeWM/awesome/milestones/1/labels","id":1069592,"number":1,"title":"next: pull requests to be merged soon","description":"Pending pull requests to be merged soon.","creator":{"login":"blueyed","id":9766,"avatar_url":"https://avatars1.githubusercontent.com/u/9766?v=4","gravatar_id":"","url":"https://api.github.com/users/blueyed","html_url":"https://github.com/blueyed","followers_url":"https://api.github.com/users/blueyed/followers","following_url":"https://api.github.com/users/blueyed/following{/other_user}","gists_url":"https://api.github.com/users/blueyed/gists{/gist_id}","starred_url":"https://api.github.com/users/blueyed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/blueyed/subscriptions","organizations_url":"https://api.github.com/users/blueyed/orgs","repos_url":"https://api.github.com/users/blueyed/repos","events_url":"https://api.github.com/users/blueyed/events{/privacy}","received_events_url":"https://api.github.com/users/blueyed/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":701,"state":"open","created_at":"2015-04-15T22:58:10Z","updated_at":"2018-02-17T12:27:21Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/awesomeWM/awesome/pulls/2160/commits","review_comments_url":"https://api.github.com/repos/awesomeWM/awesome/pulls/2160/comments","review_comment_url":"https://api.github.com/repos/awesomeWM/awesome/pulls/comments{/number}","comments_url":"https://api.github.com/repos/awesomeWM/awesome/issues/2160/comments","statuses_url":"https://api.github.com/repos/awesomeWM/awesome/statuses/ee944f4da8342187c2244edb01b90c54567129c4","head":{"label":"psychon:gdkpixbuf","ref":"gdkpixbuf","sha":"ee944f4da8342187c2244edb01b90c54567129c4","user":{"login":"psychon","id":89482,"avatar_url":"https://avatars3.githubusercontent.com/u/89482?v=4","gravatar_id":"","url":"https://api.github.com/users/psychon","html_url":"https://github.com/psychon","followers_url":"https://api.github.com/users/psychon/followers","following_url":"https://api.github.com/users/psychon/following{/other_user}","gists_url":"https://api.github.com/users/psychon/gists{/gist_id}","starred_url":"https://api.github.com/users/psychon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychon/subscriptions","organizations_url":"https://api.github.com/users/psychon/orgs","repos_url":"https://api.github.com/users/psychon/repos","events_url":"https://api.github.com/users/psychon/events{/privacy}","received_events_url":"https://api.github.com/users/psychon/received_events","type":"User","site_admin":false},"repo":{"id":28717216,"name":"awesome","full_name":"psychon/awesome","owner":{"login":"psychon","id":89482,"avatar_url":"https://avatars3.githubusercontent.com/u/89482?v=4","gravatar_id":"","url":"https://api.github.com/users/psychon","html_url":"https://github.com/psychon","followers_url":"https://api.github.com/users/psychon/followers","following_url":"https://api.github.com/users/psychon/following{/other_user}","gists_url":"https://api.github.com/users/psychon/gists{/gist_id}","starred_url":"https://api.github.com/users/psychon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychon/subscriptions","organizations_url":"https://api.github.com/users/psychon/orgs","repos_url":"https://api.github.com/users/psychon/repos","events_url":"https://api.github.com/users/psychon/events{/privacy}","received_events_url":"https://api.github.com/users/psychon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/psychon/awesome","description":"awesome window manager","fork":true,"url":"https://api.github.com/repos/psychon/awesome","forks_url":"https://api.github.com/repos/psychon/awesome/forks","keys_url":"https://api.github.com/repos/psychon/awesome/keys{/key_id}","collaborators_url":"https://api.github.com/repos/psychon/awesome/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/psychon/awesome/teams","hooks_url":"https://api.github.com/repos/psychon/awesome/hooks","issue_events_url":"https://api.github.com/repos/psychon/awesome/issues/events{/number}","events_url":"https://api.github.com/repos/psychon/awesome/events","assignees_url":"https://api.github.com/repos/psychon/awesome/assignees{/user}","branches_url":"https://api.github.com/repos/psychon/awesome/branches{/branch}","tags_url":"https://api.github.com/repos/psychon/awesome/tags","blobs_url":"https://api.github.com/repos/psychon/awesome/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/psychon/awesome/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/psychon/awesome/git/refs{/sha}","trees_url":"https://api.github.com/repos/psychon/awesome/git/trees{/sha}","statuses_url":"https://api.github.com/repos/psychon/awesome/statuses/{sha}","languages_url":"https://api.github.com/repos/psychon/awesome/languages","stargazers_url":"https://api.github.com/repos/psychon/awesome/stargazers","contributors_url":"https://api.github.com/repos/psychon/awesome/contributors","subscribers_url":"https://api.github.com/repos/psychon/awesome/subscribers","subscription_url":"https://api.github.com/repos/psychon/awesome/subscription","commits_url":"https://api.github.com/repos/psychon/awesome/commits{/sha}","git_commits_url":"https://api.github.com/repos/psychon/awesome/git/commits{/sha}","comments_url":"https://api.github.com/repos/psychon/awesome/comments{/number}","issue_comment_url":"https://api.github.com/repos/psychon/awesome/issues/comments{/number}","contents_url":"https://api.github.com/repos/psychon/awesome/contents/{+path}","compare_url":"https://api.github.com/repos/psychon/awesome/compare/{base}...{head}","merges_url":"https://api.github.com/repos/psychon/awesome/merges","archive_url":"https://api.github.com/repos/psychon/awesome/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/psychon/awesome/downloads","issues_url":"https://api.github.com/repos/psychon/awesome/issues{/number}","pulls_url":"https://api.github.com/repos/psychon/awesome/pulls{/number}","milestones_url":"https://api.github.com/repos/psychon/awesome/milestones{/number}","notifications_url":"https://api.github.com/repos/psychon/awesome/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/psychon/awesome/labels{/name}","releases_url":"https://api.github.com/repos/psychon/awesome/releases{/id}","deployments_url":"https://api.github.com/repos/psychon/awesome/deployments","created_at":"2015-01-02T15:31:52Z","updated_at":"2016-01-17T13:28:29Z","pushed_at":"2018-02-10T19:11:09Z","git_url":"git://github.com/psychon/awesome.git","ssh_url":"git@github.com:psychon/awesome.git","clone_url":"https://github.com/psychon/awesome.git","svn_url":"https://github.com/psychon/awesome","homepage":"https://awesome.naquadah.org/","size":14361,"stargazers_count":0,"watchers_count":0,"language":"Lua","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"awesomeWM:master","ref":"master","sha":"19a1ee6c16cddb5b312122be5be590682bfcf2a4","user":{"login":"awesomeWM","id":6843364,"avatar_url":"https://avatars3.githubusercontent.com/u/6843364?v=4","gravatar_id":"","url":"https://api.github.com/users/awesomeWM","html_url":"https://github.com/awesomeWM","followers_url":"https://api.github.com/users/awesomeWM/followers","following_url":"https://api.github.com/users/awesomeWM/following{/other_user}","gists_url":"https://api.github.com/users/awesomeWM/gists{/gist_id}","starred_url":"https://api.github.com/users/awesomeWM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesomeWM/subscriptions","organizations_url":"https://api.github.com/users/awesomeWM/orgs","repos_url":"https://api.github.com/users/awesomeWM/repos","events_url":"https://api.github.com/users/awesomeWM/events{/privacy}","received_events_url":"https://api.github.com/users/awesomeWM/received_events","type":"Organization","site_admin":false},"repo":{"id":17378009,"name":"awesome","full_name":"awesomeWM/awesome","owner":{"login":"awesomeWM","id":6843364,"avatar_url":"https://avatars3.githubusercontent.com/u/6843364?v=4","gravatar_id":"","url":"https://api.github.com/users/awesomeWM","html_url":"https://github.com/awesomeWM","followers_url":"https://api.github.com/users/awesomeWM/followers","following_url":"https://api.github.com/users/awesomeWM/following{/other_user}","gists_url":"https://api.github.com/users/awesomeWM/gists{/gist_id}","starred_url":"https://api.github.com/users/awesomeWM/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/awesomeWM/subscriptions","organizations_url":"https://api.github.com/users/awesomeWM/orgs","repos_url":"https://api.github.com/users/awesomeWM/repos","events_url":"https://api.github.com/users/awesomeWM/events{/privacy}","received_events_url":"https://api.github.com/users/awesomeWM/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/awesomeWM/awesome","description":"awesome window manager","fork":false,"url":"https://api.github.com/repos/awesomeWM/awesome","forks_url":"https://api.github.com/repos/awesomeWM/awesome/forks","keys_url":"https://api.github.com/repos/awesomeWM/awesome/keys{/key_id}","collaborators_url":"https://api.github.com/repos/awesomeWM/awesome/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/awesomeWM/awesome/teams","hooks_url":"https://api.github.com/repos/awesomeWM/awesome/hooks","issue_events_url":"https://api.github.com/repos/awesomeWM/awesome/issues/events{/number}","events_url":"https://api.github.com/repos/awesomeWM/awesome/events","assignees_url":"https://api.github.com/repos/awesomeWM/awesome/assignees{/user}","branches_url":"https://api.github.com/repos/awesomeWM/awesome/branches{/branch}","tags_url":"https://api.github.com/repos/awesomeWM/awesome/tags","blobs_url":"https://api.github.com/repos/awesomeWM/awesome/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/awesomeWM/awesome/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/awesomeWM/awesome/git/refs{/sha}","trees_url":"https://api.github.com/repos/awesomeWM/awesome/git/trees{/sha}","statuses_url":"https://api.github.com/repos/awesomeWM/awesome/statuses/{sha}","languages_url":"https://api.github.com/repos/awesomeWM/awesome/languages","stargazers_url":"https://api.github.com/repos/awesomeWM/awesome/stargazers","contributors_url":"https://api.github.com/repos/awesomeWM/awesome/contributors","subscribers_url":"https://api.github.com/repos/awesomeWM/awesome/subscribers","subscription_url":"https://api.github.com/repos/awesomeWM/awesome/subscription","commits_url":"https://api.github.com/repos/awesomeWM/awesome/commits{/sha}","git_commits_url":"https://api.github.com/repos/awesomeWM/awesome/git/commits{/sha}","comments_url":"https://api.github.com/repos/awesomeWM/awesome/comments{/number}","issue_comment_url":"https://api.github.com/repos/awesomeWM/awesome/issues/comments{/number}","contents_url":"https://api.github.com/repos/awesomeWM/awesome/contents/{+path}","compare_url":"https://api.github.com/repos/awesomeWM/awesome/compare/{base}...{head}","merges_url":"https://api.github.com/repos/awesomeWM/awesome/merges","archive_url":"https://api.github.com/repos/awesomeWM/awesome/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/awesomeWM/awesome/downloads","issues_url":"https://api.github.com/repos/awesomeWM/awesome/issues{/number}","pulls_url":"https://api.github.com/repos/awesomeWM/awesome/pulls{/number}","milestones_url":"https://api.github.com/repos/awesomeWM/awesome/milestones{/number}","notifications_url":"https://api.github.com/repos/awesomeWM/awesome/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/awesomeWM/awesome/labels{/name}","releases_url":"https://api.github.com/repos/awesomeWM/awesome/releases{/id}","deployments_url":"https://api.github.com/repos/awesomeWM/awesome/deployments","created_at":"2014-03-03T19:56:16Z","updated_at":"2018-02-16T14:23:02Z","pushed_at":"2018-02-17T12:27:14Z","git_url":"git://github.com/awesomeWM/awesome.git","ssh_url":"git@github.com:awesomeWM/awesome.git","clone_url":"https://github.com/awesomeWM/awesome.git","svn_url":"https://github.com/awesomeWM/awesome","homepage":"https://awesomewm.org/","size":12776,"stargazers_count":1767,"watchers_count":1767,"language":"Lua","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":261,"mirror_url":null,"archived":false,"open_issues_count":224,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0"},"forks":261,"open_issues":224,"watchers":1767,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/awesomeWM/awesome/pulls/2160"},"html":{"href":"https://github.com/awesomeWM/awesome/pull/2160"},"issue":{"href":"https://api.github.com/repos/awesomeWM/awesome/issues/2160"},"comments":{"href":"https://api.github.com/repos/awesomeWM/awesome/issues/2160/comments"},"review_comments":{"href":"https://api.github.com/repos/awesomeWM/awesome/pulls/2160/comments"},"review_comment":{"href":"https://api.github.com/repos/awesomeWM/awesome/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/awesomeWM/awesome/pulls/2160/commits"},"statuses":{"href":"https://api.github.com/repos/awesomeWM/awesome/statuses/ee944f4da8342187c2244edb01b90c54567129c4"}},"author_association":"OWNER","merged":true,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":{"login":"psychon","id":89482,"avatar_url":"https://avatars3.githubusercontent.com/u/89482?v=4","gravatar_id":"","url":"https://api.github.com/users/psychon","html_url":"https://github.com/psychon","followers_url":"https://api.github.com/users/psychon/followers","following_url":"https://api.github.com/users/psychon/following{/other_user}","gists_url":"https://api.github.com/users/psychon/gists{/gist_id}","starred_url":"https://api.github.com/users/psychon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psychon/subscriptions","organizations_url":"https://api.github.com/users/psychon/orgs","repos_url":"https://api.github.com/users/psychon/repos","events_url":"https://api.github.com/users/psychon/events{/privacy}","received_events_url":"https://api.github.com/users/psychon/received_events","type":"User","site_admin":false},"comments":3,"review_comments":0,"maintainer_can_modify":false,"commits":2,"additions":33,"deletions":8,"changed_files":5}}
{"actor":{"display_login":"psychon"}}