At 1244286306 time_t, Uli Schlachter wrote:
> If a wibox with non-north geometry was created and a wibox size was specified,
> this function happily ignored it when it made the wibox fit.
> 
> The hunk in wibox.c partly reverts 7cc0b13eae2638aaab40bfd1632036a6bea4d8d4.
> No idea if this is a good idea or why that one was done...
> 
> Thanks to Garoth who found this bug.

Do you have a way to reproduce this, because I'm torturing my tired mind
but I can't find why your patche is needed?

> ---
>  lib/awful/wibox.lua.in |   24 ++++++++++++++++++------
>  wibox.c                |    4 ++--
>  2 files changed, 20 insertions(+), 8 deletions(-)
> 
> diff --git a/lib/awful/wibox.lua.in b/lib/awful/wibox.lua.in
> index 190caea..48c710c 100644
> --- a/lib/awful/wibox.lua.in
> +++ b/lib/awful/wibox.lua.in
> @@ -237,14 +237,26 @@ function new(arg)
>      -- Empty position and align in arg so we are passing deprecation warning
>      arg.position = nil
>  
> +    -- Set default size
> +    if position == "left" or position == "right" then
> +        arg.width = arg.width or capi.awesome.font_height * 1.5
> +        arg.height = arg.height or 100
> +    else
> +        arg.width = arg.width or 100
> +        arg.height = arg.height or capi.awesome.font_height * 1.5
> +    end
> +
>      local w = capi.wibox(arg)
>  
> -    if position == "left" then
> -        w.orientation = "north"
> -        w:geometry({ width = capi.awesome.font_height * 1.5 })
> -    elseif position == "right" then
> -        w.orientation = "south"
> -        w:geometry({ width = capi.awesome.font_height * 1.5 })
> +    if position == "left" or position == "right" then
> +        if position == "left" then
> +            w.orientation = "north"
> +        else
> +            w.orientation = "south"
> +        end
> +        -- We need to swap width and height
> +        local old_geom = w:geometry()
> +        w:geometry({ width = old_geom.height, height = old_geom.width })
>      end

Can't you do that before calling constructor?

>  
>      w.screen = arg.screen or 1
> diff --git a/wibox.c b/wibox.c
> index 69009c9..a54634c 100644
> --- a/wibox.c
> +++ b/wibox.c
> @@ -488,8 +488,8 @@ luaA_wibox_new(lua_State *L)
>      w->sw.border.width = luaA_getopt_number(L, 2, "border_width", 0);
>      w->sw.geometry.x = luaA_getopt_number(L, 2, "x", 0);
>      w->sw.geometry.y = luaA_getopt_number(L, 2, "y", 0);
> -    w->sw.geometry.width = luaA_getopt_number(L, 2, "width", 100);
> -    w->sw.geometry.height = luaA_getopt_number(L, 2, "height", 
> globalconf.font->height * 1.5);
> +    w->sw.geometry.width = luaA_getopt_number(L, 2, "width", 0);
> +    w->sw.geometry.height = luaA_getopt_number(L, 2, "height", 0);

I'd be afraid about X errors. I don't know if we check later about that.
Anyway that wouldn't be your fault/responsability. :-/

Cheers,
-- 
Julien Danjou
// ᐰ <jul...@danjou.info>   http://julien.danjou.info
// 9A0D 5FD9 EB42 22F6 8974  C95C A462 B51E C2FE E5CD
// When I get sad, I stop being sad and be awesome instead. True story.

Attachment: signature.asc
Description: Digital signature

Reply via email to