LOG("using current container, focused = %p, focused->name = %s\n",
focused, focused->name);
nc = focused;
- } else nc = tree_open_con(NULL, true);
+ } else nc = tree_open_con(NULL);
} else {
/* M_ACTIVE are assignments */
if (match != NULL && match->insert_where == M_ACTIVE) {
/* We need to open a new con */
/* TODO: make a difference between match-once containers (directly assign
* cwindow) and match-multiple (tree_open_con first) */
- nc = tree_open_con(nc->parent, true);
+ nc = tree_open_con(nc->parent);
}
/* M_BELOW inserts the new window as a child of the one which was
* matched (e.g. dock areas) */
else if (match != NULL && match->insert_where == M_BELOW) {
- nc = tree_open_con(nc, !cwindow->dock);
+ nc = tree_open_con(nc);
}
}
x_set_name(nc, name);
free(name);
+ Con *ws = con_get_workspace(nc);
+ Con *fs = (ws ? con_get_fullscreen_con(ws) : NULL);
+
+ if (fs == NULL) {
+ DLOG("Not in fullscreen mode, focusing\n");
+ if (!cwindow->dock)
+ con_focus(nc);
+ else DLOG("dock, not focusing\n");
+ } else {
+ DLOG("fs = %p, ws = %p, not focusing\n", fs, ws);
+ }
+
/* set floating if necessary */
bool want_floating = false;
if (xcb_reply_contains_atom(reply, atoms[_NET_WM_WINDOW_TYPE_DIALOG]) ||
LOG("This window is transiert for another window, setting floating\n");
want_floating = true;
- if (config.popup_during_fullscreen == PDF_LEAVE_FULLSCREEN) {
- Con *ws, *fs;
- if ((ws = con_get_workspace(nc)) &&
- (fs = con_get_fullscreen_con(ws))) {
- LOG("There is a fullscreen window, leaving fullscreen mode\n");
- con_toggle_fullscreen(fs);
- }
+ if (config.popup_during_fullscreen == PDF_LEAVE_FULLSCREEN &&
+ fs != NULL) {
+ LOG("There is a fullscreen window, leaving fullscreen mode\n");
+ con_toggle_fullscreen(fs);
}
}
* Opens an empty container in the current container
*
*/
-Con *tree_open_con(Con *con, bool focus_it) {
+Con *tree_open_con(Con *con) {
if (con == NULL) {
/* every focusable Con has a parent (outputs have parent root) */
con = focused->parent;
/* 4: re-calculate child->percent for each child */
con_fix_percent(con);
- /* 5: focus the new container */
- if (focus_it)
- con_focus(new);
-
return new;
}