*/
void client_change_border(xcb_connection_t *conn, Client *client, char border_type);
+/**
+ * Change the border type for the given client to normal (n), 1px border (p) or
+ * completely borderless (b) without actually re-rendering the layout. Useful
+ * for calling it when initializing a new client.
+ *
+ */
+bool client_init_border(xcb_connection_t *conn, Client *client, char border_type);
+
/**
* Unmap the client, correctly setting any state which is needed.
*
int container_stack_limit;
int container_stack_limit_value;
+ const char *default_border;
+
/** The modifier which needs to be pressed in combination with your mouse
* buttons to do things with floating windows (move, resize) */
uint32_t floating_modifier;
ipc-socket { BEGIN(BIND_AWS_COND); return TOKIPCSOCKET; }
ipc_socket { BEGIN(BIND_AWS_COND); return TOKIPCSOCKET; }
new_container { return TOKNEWCONTAINER; }
+new_window { return TOKNEWWINDOW; }
default { yylval.number = MODE_DEFAULT; return TOKCONTAINERMODE; }
stacking { yylval.number = MODE_STACK; return TOKCONTAINERMODE; }
tabbed { yylval.number = MODE_TABBED; return TOKCONTAINERMODE; }
%token TOKARROW
%token TOKMODE
%token TOKNEWCONTAINER
+%token TOKNEWWINDOW
%token TOKCONTAINERMODE
%token TOKSTACKLIMIT
| mode
| floating_modifier
| new_container
+ | new_window
| workspace
| assign
| ipcsocket
}
;
+new_window:
+ TOKNEWWINDOW WHITESPACE WORD
+ {
+ LOG("new windows should start in mode %s\n", $<string>3);
+ config.default_border = strdup($<string>3);
+ }
+ ;
+
workspace:
TOKWORKSPACE WHITESPACE NUMBER WHITESPACE TOKSCREEN WHITESPACE screen optional_workspace_name
{
/*
* Change the border type for the given client to normal (n), 1px border (p) or
- * completely borderless (b).
+ * completely borderless (b) without actually re-rendering the layout. Useful
+ * for calling it when initializing a new client.
*
*/
-void client_change_border(xcb_connection_t *conn, Client *client, char border_type) {
+bool client_init_border(xcb_connection_t *conn, Client *client, char border_type) {
switch (border_type) {
case 'n':
LOG("Changing to normal border\n");
client->titlebar_position = TITLEBAR_TOP;
client->borderless = false;
- break;
+ return true;
case 'p':
LOG("Changing to 1px border\n");
client->titlebar_position = TITLEBAR_OFF;
client->borderless = false;
- break;
+ return true;
case 'b':
LOG("Changing to borderless\n");
client->titlebar_position = TITLEBAR_OFF;
client->borderless = true;
- break;
+ return true;
default:
LOG("Unknown border mode\n");
- return;
+ return false;
}
+}
+
+/*
+ * Change the border type for the given client to normal (n), 1px border (p) or
+ * completely borderless (b).
+ *
+ */
+void client_change_border(xcb_connection_t *conn, Client *client, char border_type) {
+ if (!client_init_border(conn, client, border_type))
+ return;
/* Ensure that the child’s position inside our window gets updated */
client->force_reconfigure = true;
new->floating_rect.width = width;
new->floating_rect.height = height;
+ if (config.default_border != NULL)
+ client_init_border(conn, new, config.default_border[1]);
+
mask = 0;
/* Don’t generate events for our new window, it should *not* be managed */