{"action":"created","issue":{"url":"https://api.github.com/repos/zealdocs/zeal/issues/211","labels_url":"https://api.github.com/repos/zealdocs/zeal/issues/211/labels{/name}","comments_url":"https://api.github.com/repos/zealdocs/zeal/issues/211/comments","events_url":"https://api.github.com/repos/zealdocs/zeal/issues/211/events","html_url":"https://github.com/zealdocs/zeal/issues/211","id":45802202,"number":211,"title":"Zeal makes Xorg use 100% cpu","user":{"login":"LeonB","id":3979,"avatar_url":"https://avatars.githubusercontent.com/u/3979?v=3","gravatar_id":"","url":"https://api.github.com/users/LeonB","html_url":"https://github.com/LeonB","followers_url":"https://api.github.com/users/LeonB/followers","following_url":"https://api.github.com/users/LeonB/following{/other_user}","gists_url":"https://api.github.com/users/LeonB/gists{/gist_id}","starred_url":"https://api.github.com/users/LeonB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeonB/subscriptions","organizations_url":"https://api.github.com/users/LeonB/orgs","repos_url":"https://api.github.com/users/LeonB/repos","events_url":"https://api.github.com/users/LeonB/events{/privacy}","received_events_url":"https://api.github.com/users/LeonB/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/zealdocs/zeal/labels/bug","name":"bug","color":"e11d21"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":22,"created_at":"2014-10-14T21:24:34Z","updated_at":"2015-11-06T16:39:32Z","closed_at":null,"body":"I'm on Ubuntu 14.10 and when using Zeal from the ppa, after a few minutes, Xorg starts using 100% cpu.The weird thing is that the zeal process itself doesn't show much cpu usage in top."},"comment":{"url":"https://api.github.com/repos/zealdocs/zeal/issues/comments/154464210","html_url":"https://github.com/zealdocs/zeal/issues/211#issuecomment-154464210","issue_url":"https://api.github.com/repos/zealdocs/zeal/issues/211","id":154464210,"user":{"login":"rajeebk","id":1547861,"avatar_url":"https://avatars.githubusercontent.com/u/1547861?v=3","gravatar_id":"","url":"https://api.github.com/users/rajeebk","html_url":"https://github.com/rajeebk","followers_url":"https://api.github.com/users/rajeebk/followers","following_url":"https://api.github.com/users/rajeebk/following{/other_user}","gists_url":"https://api.github.com/users/rajeebk/gists{/gist_id}","starred_url":"https://api.github.com/users/rajeebk/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rajeebk/subscriptions","organizations_url":"https://api.github.com/users/rajeebk/orgs","repos_url":"https://api.github.com/users/rajeebk/repos","events_url":"https://api.github.com/users/rajeebk/events{/privacy}","received_events_url":"https://api.github.com/users/rajeebk/received_events","type":"User","site_admin":false},"created_at":"2015-11-06T16:39:32Z","updated_at":"2015-11-06T16:39:32Z","body":"Below is some hack I did to lessen the slow search and CPU usage. I just wanted to make the search process not run every time I type a letter, but only when pressing Return or something like that. It still takes 3 to 6 seconds to search all documents, but at least it doesn't multiply the delay by the number of keystrokes. When I also specifiy the document to search, it is instantaneous, e.g. \"bash:return\".\r\nSome issue I found is that when a search returns nothing, subsequent Return keypress event does not get passed, so nothing is searched after that, even though I can type letters in the edit box. I had to click some other place or move the mouse outside the Zeal window to jumpstart the search.\r\nOne other issue is the error about calling some NetworkReply or something twice.\r\nAnyway, I hope this hack will give some idea how to fix the real issue.\r\n```\r\n--- src/ui/mainwindow.cpp.orig\t2015-11-05 14:27:24.000000000 -0800\r\n+++ src/ui/mainwindow.cpp\t2015-11-06 08:25:32.411610585 -0800\r\n@@ -187,12 +187,13 @@\r\n     setupSearchBoxCompletions();\r\n     ui->treeView->setModel(m_zealListModel);\r\n     ui->treeView->setColumnHidden(1, true);\r\n+/*\r\n     SearchItemDelegate *delegate = new SearchItemDelegate(ui->treeView);\r\n     connect(ui->lineEdit, &QLineEdit::textChanged, [delegate](const QString &te\r\nxt) {\r\n         delegate->setHighlight(Zeal::SearchQuery::fromString(text).query());\r\n     });\r\n     ui->treeView->setItemDelegate(delegate);\r\n-\r\n+*/\r\n     createTab();\r\n     /// FIXME: QTabBar does not emit currentChanged() after the first addTab() \r\ncall\r\n     reloadTabState();\r\n@@ -255,10 +256,10 @@\r\n         }\r\n     });\r\n \r\n-    connect(ui->lineEdit, &QLineEdit::textChanged, [this](const QString &text) \r\n{\r\n+    connect(ui->lineEdit, &QLineEdit::editingFinished, [this]() {\r\n+        const QString& text = ui->lineEdit->text();\r\n         if (!m_searchState || text == m_searchState->searchQuery)\r\n             return;\r\n-\r\n         m_searchState->searchQuery = text;\r\n         m_application->docsetRegistry()->search(text);\r\n         if (text.isEmpty()) {\r\n```"}}