Re: Delayed autoraise

2014-03-31 Thread Uli Schlachter
Hi,

On 31.03.2014 11:06, Eugen Dedu wrote:
 I have been using awesome since a few months now, but there is one thing 
 I really miss: sloppy focus with autoraise after some delay.
 
 I modified rc.lua from
 client.connect_signal(focus, function(c) c.border_color = 
 beautiful.border_focus end)
 to
 client.connect_signal(focus, function(c) c.border_color = 
 beautiful.border_focus ; c:raise() end)
[...]
 How to achieve this autoraising after some delay?  In other WM it is 
 possible to set a delay before autoraising, for ex. 500 ms.

Untested:

autoraise_target = nil
autoraise_timer = timer { timeout = 0.5 }
autoraise_timer:connect_signal(timeout, function()
  if autoraise_target then autoraise_target:raise() end
  autoraise_timer:stop()
end)
client.connect_signal(mouse::enter, function(c)
  autoraise_target = c
  autoraise_timer:again()
end)
client.connect_signal(mouse::leave, function(c)
  if autoraise_target == c then autoraise_target = nil end
end)

Uli
-- 
A learning experience is one of those things that say,
'You know that thing you just did? Don't do that.'
 -- Douglas Adams

-- 
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.


Re: Delayed autoraise

2014-03-31 Thread Manuel Kasser
Tested and in productive use:

function delayFunctionCall(time, funct)
local t = timer({ timeout = time or 0.01 })
t:connect_signal(timeout, function() t:stop(); funct() end)
t:start()
end

just hand over your wanted delay (if nil, 0.01s is used) and the
function doing what you want to have delayed. Works like a charm for me.

Cheers,
Manuel

-- 
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.


Re: Delayed autoraise

2014-03-31 Thread Eugen Dedu

On 31/03/14 12:56, Uli Schlachter wrote:

Hi,

On 31.03.2014 11:06, Eugen Dedu wrote:

I have been using awesome since a few months now, but there is one thing
I really miss: sloppy focus with autoraise after some delay.

I modified rc.lua from
client.connect_signal(focus, function(c) c.border_color =
beautiful.border_focus end)
to
client.connect_signal(focus, function(c) c.border_color =
beautiful.border_focus ; c:raise() end)

[...]

How to achieve this autoraising after some delay?  In other WM it is
possible to set a delay before autoraising, for ex. 500 ms.


Untested:

autoraise_target = nil
autoraise_timer = timer { timeout = 0.5 }
autoraise_timer:connect_signal(timeout, function()
   if autoraise_target then autoraise_target:raise() end
   autoraise_timer:stop()
end)
client.connect_signal(mouse::enter, function(c)
   autoraise_target = c
   autoraise_timer:again()
end)
client.connect_signal(mouse::leave, function(c)
   if autoraise_target == c then autoraise_target = nil end
end)


This is what I wanted, thank you!!

--
Eugen

--
To unsubscribe, send mail to awesome-unsubscr...@naquadah.org.