{"action":"created","issue":{"url":"https://api.github.com/repos/LemonBoy/bar/issues/163","repository_url":"https://api.github.com/repos/LemonBoy/bar","labels_url":"https://api.github.com/repos/LemonBoy/bar/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/LemonBoy/bar/issues/163/comments","events_url":"https://api.github.com/repos/LemonBoy/bar/issues/163/events","html_url":"https://github.com/LemonBoy/bar/issues/163","id":126042467,"number":163,"title":"`-g` doesn't work as expected","user":{"login":"vain","id":82671,"avatar_url":"https://avatars.githubusercontent.com/u/82671?v=3","gravatar_id":"","url":"https://api.github.com/users/vain","html_url":"https://github.com/vain","followers_url":"https://api.github.com/users/vain/followers","following_url":"https://api.github.com/users/vain/following{/other_user}","gists_url":"https://api.github.com/users/vain/gists{/gist_id}","starred_url":"https://api.github.com/users/vain/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vain/subscriptions","organizations_url":"https://api.github.com/users/vain/orgs","repos_url":"https://api.github.com/users/vain/repos","events_url":"https://api.github.com/users/vain/events{/privacy}","received_events_url":"https://api.github.com/users/vain/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-01-11T21:37:30Z","updated_at":"2016-12-03T12:28:19Z","closed_at":null,"body":"I'm having trouble with `-g`. To illustrate, I added the following call to `fprintf()`:\n\n``` diff\ndiff --git a/lemonbar.c b/lemonbar.c\nindex cfd4d9b..d5c1d55 100644\n--- a/lemonbar.c\n+++ b/lemonbar.c\n@@ -752,6 +752,8 @@ monitor_new (int x, int y, int width, int height)\n     ret->next = ret->prev = NULL;\n     ret->window = xcb_generate_id(c);\n\n+    fprintf(stderr, \"creating window at %d %d, %d %d\\n\", ret->x, ret->y, ret->width, bh);\n+\n     int depth = (visual == scr->root_visual) ? XCB_COPY_FROM_PARENT : 32;\n     xcb_create_window(c, depth, ret->window, scr->root,\n             ret->x, ret->y, width, bh, 0,\n```\n\nNow, let's say my screen setup is as follows:\n\n```\nHDMI1 connected primary 1024x768+0+0\nVGA1 connected 1280x1024+1024+0\n```\n\nIt seems to be important that the screen on the right is larger in height than the first screen.\n\nLet's run lemonbar:\n\n```\n$ ./lemonbar -dp -B '#ff0000' -g 1280x1+1024+768\ncreating window at 1024 768, 1280 1\n```\n\nThis works as expected. I get a red line on the second monitor.\n\nNow let's increase the `y` coordinate by one pixel:\n\n```\n$ ./lemonbar -dp -B '#ff0000' -g 1280x1+1024+769\ncreating window at 2048 769, 256 1\n```\n\nThat's a little strange, isn't it? `y` and `bh` are correct, but `x` and `w` are wrong.\n\nI can get the bar to show up at the desired coordinates by setting `x` to 0:\n\n```\n$ ./lemonbar -dp -B '#ff0000' -g 1280x1+0+769\ncreating window at 1024 769, 1280 1\n```\n\nI'm sorry that I can't provide a patch yet. I don't fully understand what's going on in `monitor_create_chain()`.\n\nDo you have any ideas?\n\nThank you!\n"},"comment":{"url":"https://api.github.com/repos/LemonBoy/bar/issues/comments/264636435","html_url":"https://github.com/LemonBoy/bar/issues/163#issuecomment-264636435","issue_url":"https://api.github.com/repos/LemonBoy/bar/issues/163","id":264636435,"user":{"login":"LemonBoy","id":77388,"avatar_url":"https://avatars.githubusercontent.com/u/77388?v=3","gravatar_id":"","url":"https://api.github.com/users/LemonBoy","html_url":"https://github.com/LemonBoy","followers_url":"https://api.github.com/users/LemonBoy/followers","following_url":"https://api.github.com/users/LemonBoy/following{/other_user}","gists_url":"https://api.github.com/users/LemonBoy/gists{/gist_id}","starred_url":"https://api.github.com/users/LemonBoy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LemonBoy/subscriptions","organizations_url":"https://api.github.com/users/LemonBoy/orgs","repos_url":"https://api.github.com/users/LemonBoy/repos","events_url":"https://api.github.com/users/LemonBoy/events{/privacy}","received_events_url":"https://api.github.com/users/LemonBoy/received_events","type":"User","site_admin":false},"created_at":"2016-12-03T12:28:19Z","updated_at":"2016-12-03T12:28:19Z","body":"The Xinerama/Xrandr magic is used because the bar is replicated on all the monitors and each monitor gets its own window. The `-g` command tries to break down the desired geometry into monitor-sized bites and place them in the (hopefully) right place with the obvious caveat that there are so many layouts in the wild that the code doesn't handle (patches are more than welcome)."}}
{"actor":{"display_login":"LemonBoy"}}