client_t *c = make_client(win);
update_floating_rectangle(c);
+ c->floating_rectangle.x += m->rectangle.x;
+ c->floating_rectangle.y += m->rectangle.y;
c->frame = frame;
xcb_icccm_get_wm_class_reply_t reply;
n->client = c;
insert_node(m, d, n, d->focus);
+ translate_position(m, m, n);
disable_floating_atom(c->window);
set_floating(n, floating);
set_fullscreen(n, fullscreen);
c->transient = transient;
- xcb_rectangle_t *frect = &n->client->floating_rectangle;
- if (frect->x == 0 && frect->y == 0)
- center(m->rectangle, frect);
- fit_monitor(m, n->client);
-
arrange(m, d);
bool give_focus = (takes_focus && (d == mon->desk || follow));
p->node = p->vertical_fence = p->horizontal_fence = NULL;
p->client = NULL;
p->window = XCB_NONE;
+ p->action = ACTION_NONE;
return p;
}
-void center(xcb_rectangle_t a, xcb_rectangle_t *b)
-{
- if (b->width < a.width)
- b->x = a.x + (a.width - b->width) / 2;
- if (b->height < a.height)
- b->y = a.y + (a.height - b->height) / 2;
-}
-
bool contains(xcb_rectangle_t a, xcb_rectangle_t b)
{
return (a.x <= b.x && (a.x + a.width) >= (b.x + b.width)