awesome

Welcome to awesome bug tracking system.
Tasklist

FS#885 - new signal post_arrange

Attached to Project: awesome
Opened by awesome fan (awesomefan) - Saturday, 09 April 2011, 09:11 GMT
Last edited by Uli Schlachter (psychon) - Saturday, 09 April 2011, 09:31 GMT
Task Type Feature Request
Category Core
Status Closed
Assigned To No-one
Operating System All
Severity Low
Priority Normal
Reported Version git/master
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I am using awesome 3.4.9, built from source, on Debian 6.

I would like to get the client under the mouse pointer whenever the layout is rearranged (e.g. a new client is added, the tags are switched, etc.)
Is there any method to do so? I tried the arrange signal of screen, but calling awful.mouse:client_under_pointer() in the callback always returns the client under pointer in regard to the old layout, not the new one.
This task depends upon

Closed by  Uli Schlachter (psychon)
Saturday, 09 April 2011, 09:31 GMT
Reason for closing:  Not a bug
Additional comments about closing:  The arrange signal is emitted after the layout is run, not before (= does exactly what you want it to do). The problem you are hitting is that awesome does lazy (un)banning to avoid some flicker. So awesome's internal state was already changed to the new layout, but the X11 server wasn't told about any of this yet (We do ask the X11 server for client_under_pointer()).

Ugly workaround: Use a timer!

local t = timer({timeout = 0})
t:add_signal("timeout", function() t:stop() local c = awful.mouse.client_under_pointer() print(c) end)
t:start()

This would make sure that your code runs after the tag switch is handled completely (= in the next main loop iteration, in this case).
Comment by awesome fan (awesomefan) - Saturday, 09 April 2011, 09:57 GMT
Uli,
thank you very much! It works great :D

Loading...