#include "rule.h"
#include "settings.h"
#include "stack.h"
-#include "tag.h"
#include "tree.h"
#include "window.h"
return;
bool floating = false, fullscreen = false, locked = false, sticky = false, follow = false, transient = false, takes_focus = true, frame = false, private = false, manage = true;
- unsigned int tags_field = 0;
- handle_rules(win, &m, &d, &tags_field, &floating, &fullscreen, &locked, &sticky, &follow, &transient, &takes_focus, &frame, &private, &manage);
+ handle_rules(win, &m, &d, &floating, &fullscreen, &locked, &sticky, &follow, &transient, &takes_focus, &frame, &private, &manage);
if (!manage) {
disable_floating_atom(win);
client_t *c = make_client(win);
update_floating_rectangle(c);
- c->tags_field = (tags_field == 0 ? d->tags_field : tags_field);
+ 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;
- tag_node(m, d, n, d, n->client->tags_field);
-
- 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));
- if (is_visible(d, n)) {
- if (give_focus)
- focus_node(m, d, n);
- else if (takes_focus)
- pseudo_focus(d, n);
- else
- stack(n);
- } else {
- stack_under(n);
- }
+ if (give_focus)
+ focus_node(m, d, n);
+ else if (takes_focus)
+ pseudo_focus(d, n);
+ else
+ stack(n, STACK_ABOVE);
uint32_t values[] = {get_event_mask(n->client)};
xcb_change_window_attributes(dpy, c->window, XCB_CW_EVENT_MASK, values);
- if (visible && is_visible(d, n)) {
+ if (visible) {
if (d == m->desk)
window_show(n->client->window);
else
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)
ewmh_wm_state_add(c, ewmh->_NET_WM_STATE_FULLSCREEN);
else
ewmh_wm_state_remove(c, ewmh->_NET_WM_STATE_FULLSCREEN);
- stack(n);
+ stack(n, STACK_ABOVE);
}
void set_floating(node_t *n, bool value)
rotate_brother(n);
}
- stack(n);
+ stack(n, STACK_ABOVE);
}
void set_locked(monitor_t *m, desktop_t *d, node_t *n, bool value)
clear_input_focus();
for (monitor_t *m = mon_head; m != NULL; m = m->next)
for (node_t *n = first_extrema(m->desk->root); n != NULL; n = next_leaf(n, m->desk->root))
- if (is_visible(m->desk, n))
- window_set_visibility(n->client->window, visible);
+ window_set_visibility(n->client->window, visible);
if (visible)
update_input_focus();
}