Excerpts from Uli Schlachter's message of Wed May 18 20:24:26 +0200 2011:
> On 18.05.2011 19:35, John Wyzer wrote:
> > Meaning: can I find the parent of a new window?
> 
> c.transient_for
> 

>> Usecase: If the dialog belongs to the application I'm currently using, show 
>> me
>> the dialog. If not, lower it until I'm interested :-)

Thanks a million! Just to have it documented, this seems to do what I want:

-- {{{ Rules
awful.rules.rules = {
    -- All clients will match this rule.
    { rule = { },
      properties = { border_width = beautiful.border_width,
                     border_color = beautiful.border_normal,
                     focus = false, lower=true,  
                     keys = clientkeys,
                     buttons = clientbuttons } },
    { rule = { class = "MPlayer" },
      properties = { floating = true , lower=false, focus=true } },
    { rule = { class = "pinentry" },
      properties = { floating = true, lower=false, focus=true} },
    { rule = { class = "gimp" },
      properties = { floating = true } },
}
-- }}}

-- {{{ Signals
-- Signal function to execute when a new client appears.
client.add_signal("manage", function (c, startup)


    if not startup then
        -- Put windows in a smart way, only if they does not set an initial 
position.
        if not c.size_hints.user_position and not c.size_hints.program_position 
then
            awful.placement.no_overlap(c)
            awful.placement.no_offscreen(c)
        end
    end
    if c.transient_for == client.focus then
        client.focus=c
        c:raise()
    end
end)

-- 
To unsubscribe, send mail to [email protected].

Reply via email to