From 25a1b198ae7ad94b020e023b8dc9bfd3e3557785 Mon Sep 17 00:00:00 2001 From: Alexander Yakushev Date: Sun, 23 Oct 2011 02:03:05 +0300 Subject: Improve UTF symbol transformation from Jamendo responses Awesompd was working with 1 or 2-byte symbols (up to \u7ff). This commit fixes that, allowing UTF symbols up to 4 bytes. Also a change was made to be able to replace on search box with other. It is useful when search crashes (it still happens sometimes) and the searchbox is just hanging there. --- awesompd.lua | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'awesompd.lua') diff --git a/awesompd.lua b/awesompd.lua index 1a1e0aa..f59d77d 100644 --- a/awesompd.lua +++ b/awesompd.lua @@ -30,6 +30,7 @@ local beautiful = require('beautiful') local naughty = naughty local awful = awful local format = string.format +local keygrabber = keygrabber -- Debug stuff @@ -921,8 +922,10 @@ end -- Use it like this: -- self:display_inputbox("Search music on Jamendo", "Artist", print) function awesompd:display_inputbox(title_text, prompt_text, hook) - if self.inputbox then -- Inputbox already exists, do nothing - return + if self.inputbox then -- Inputbox already exists, replace it + keygrabber.stop() + self.inputbox.screen = nil + self.inputbox = nil end local width = 200 local height = 30 -- cgit v1.2.3