mirror of
https://github.com/awesomeWM/awesome
synced 2024-11-17 07:47:41 +01:00
wibox: handle position on new correctly
We do not need to call setposition since we are not attached. We just need to set orientation and position_update to get the right coords. Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
parent
a8124ad269
commit
b3580fc519
1 changed files with 20 additions and 3 deletions
23
wibox.c
23
wibox.c
|
@ -641,12 +641,29 @@ luaA_wibox_new(lua_State *L)
|
||||||
|
|
||||||
w->sw.border.width = luaA_getopt_number(L, 2, "border_width", 0);
|
w->sw.border.width = luaA_getopt_number(L, 2, "border_width", 0);
|
||||||
|
|
||||||
|
buf = luaA_getopt_lstring(L, 2, "position", "top", &len);
|
||||||
|
|
||||||
|
switch((w->position = position_fromstr(buf, len)))
|
||||||
|
{
|
||||||
|
case Bottom:
|
||||||
|
case Top:
|
||||||
|
case Floating:
|
||||||
|
simplewindow_orientation_set(&w->sw, East);
|
||||||
|
break;
|
||||||
|
case Left:
|
||||||
|
simplewindow_orientation_set(&w->sw, North);
|
||||||
|
break;
|
||||||
|
case Right:
|
||||||
|
simplewindow_orientation_set(&w->sw, South);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* recompute position */
|
||||||
|
wibox_position_update(w);
|
||||||
|
|
||||||
w->sw.geometry.width = luaA_getopt_number(L, 2, "width", 0);
|
w->sw.geometry.width = luaA_getopt_number(L, 2, "width", 0);
|
||||||
w->sw.geometry.height = luaA_getopt_number(L, 2, "height", 0);
|
w->sw.geometry.height = luaA_getopt_number(L, 2, "height", 0);
|
||||||
|
|
||||||
buf = luaA_getopt_lstring(L, 2, "position", "top", &len);
|
|
||||||
wibox_setposition(w, position_fromstr(buf, len));
|
|
||||||
|
|
||||||
w->screen = SCREEN_UNDEF;
|
w->screen = SCREEN_UNDEF;
|
||||||
w->isvisible = true;
|
w->isvisible = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue