{"action":"created","issue":{"url":"https://api.github.com/repos/lanoxx/tilda/issues/116","labels_url":"https://api.github.com/repos/lanoxx/tilda/issues/116/labels{/name}","comments_url":"https://api.github.com/repos/lanoxx/tilda/issues/116/comments","events_url":"https://api.github.com/repos/lanoxx/tilda/issues/116/events","html_url":"https://github.com/lanoxx/tilda/pull/116","id":56152131,"number":116,"title":"Prevent repetitive PULL_TOGGLE when autohide option is used","user":{"login":"furkanmustafa","id":596741,"avatar_url":"https://avatars.githubusercontent.com/u/596741?v=3","gravatar_id":"","url":"https://api.github.com/users/furkanmustafa","html_url":"https://github.com/furkanmustafa","followers_url":"https://api.github.com/users/furkanmustafa/followers","following_url":"https://api.github.com/users/furkanmustafa/following{/other_user}","gists_url":"https://api.github.com/users/furkanmustafa/gists{/gist_id}","starred_url":"https://api.github.com/users/furkanmustafa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furkanmustafa/subscriptions","organizations_url":"https://api.github.com/users/furkanmustafa/orgs","repos_url":"https://api.github.com/users/furkanmustafa/repos","events_url":"https://api.github.com/users/furkanmustafa/events{/privacy}","received_events_url":"https://api.github.com/users/furkanmustafa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-01T04:58:13Z","updated_at":"2015-02-04T20:32:21Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/lanoxx/tilda/pulls/116","html_url":"https://github.com/lanoxx/tilda/pull/116","diff_url":"https://github.com/lanoxx/tilda/pull/116.diff","patch_url":"https://github.com/lanoxx/tilda/pull/116.patch"},"body":"I had a problem hiding tilda with toggle hot key when `auto_hide_on_focus_lost` was enabled. Autohide was working perfectly. But if I try to hide with the toggle key, it was getting back instantly. When I compiled it with the debug mode, the following output happened (in an instant way) when I tried toggle hiding the window.\r\n\r\n```\r\ntilda_window.c: FUNCTION ENTERED: focus_out_event_cb\r\ntilda_window.c: FUNCTION ENTERED: start_auto_hide_tick\r\nkey_grabber.c: FUNCTION ENTERED: pull\r\nkey_grabber.c: FUNCTION ENTERED: onKeybindingPull\r\nkey_grabber.c: FUNCTION ENTERED: pull\r\ntilda_window.c: FUNCTION ENTERED: focus_term\r\nkey_grabber.c: FUNCTION ENTERED: tilda_window_set_active\r\n```\r\n\r\nThe main reason is a false alarm of losing focus when toggle key is used. So it quickly does two things in order; 1) Autohide (lost focus)  2) Toggle, which is reverting it again.\r\n\r\nMy solution here might be an ugly workaround, not sure. I've added a small timeout (150ms) for a PULL_TOGGLE action to be able to happen after a PULL_UP action.\r\n\r\nHad to move `enum pull_state` into `tilda_window.h`, please relocate if you dislike it there.\r\n\r\nAnd thanks for nice piece for software :)\r\n"},"comment":{"url":"https://api.github.com/repos/lanoxx/tilda/issues/comments/72932974","html_url":"https://github.com/lanoxx/tilda/pull/116#issuecomment-72932974","issue_url":"https://api.github.com/repos/lanoxx/tilda/issues/116","id":72932974,"user":{"login":"furkanmustafa","id":596741,"avatar_url":"https://avatars.githubusercontent.com/u/596741?v=3","gravatar_id":"","url":"https://api.github.com/users/furkanmustafa","html_url":"https://github.com/furkanmustafa","followers_url":"https://api.github.com/users/furkanmustafa/followers","following_url":"https://api.github.com/users/furkanmustafa/following{/other_user}","gists_url":"https://api.github.com/users/furkanmustafa/gists{/gist_id}","starred_url":"https://api.github.com/users/furkanmustafa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/furkanmustafa/subscriptions","organizations_url":"https://api.github.com/users/furkanmustafa/orgs","repos_url":"https://api.github.com/users/furkanmustafa/repos","events_url":"https://api.github.com/users/furkanmustafa/events{/privacy}","received_events_url":"https://api.github.com/users/furkanmustafa/received_events","type":"User","site_admin":false},"created_at":"2015-02-04T20:32:21Z","updated_at":"2015-02-04T20:32:21Z","body":"Yea, #57 and #106 also looks like the same issue. And as it's said in the other issues, this might be a window manager bug actually, a global hotkey shouldn't blur/unfocus the current window. And my solution here then, really is a workaround, since it doesn't (and cannot) fix the main issue.\r\n\r\nPlease let me know if it works for you! Thanks."}}