Remove the A_TO_OUTPUT option as it is not needed anymore and will not be implemented in favor of normal assignments.

next
Ingo Bürk 2015-03-16 20:18:03 +01:00
parent 1b69ddacbe
commit 52f918309b
3 changed files with 14 additions and 22 deletions

View File

@ -460,7 +460,6 @@ struct Assignment {
* *
* A_COMMAND = run the specified command for the matching window * A_COMMAND = run the specified command for the matching window
* A_TO_WORKSPACE = assign the matching window to the specified workspace * A_TO_WORKSPACE = assign the matching window to the specified workspace
* A_TO_OUTPUT = assign the matching window to the specified output
* *
* While the type is a bitmask, only one value can be set at a time. It is * While the type is a bitmask, only one value can be set at a time. It is
* a bitmask to allow filtering for multiple types, for example in the * a bitmask to allow filtering for multiple types, for example in the
@ -470,18 +469,16 @@ struct Assignment {
enum { enum {
A_ANY = 0, A_ANY = 0,
A_COMMAND = (1 << 0), A_COMMAND = (1 << 0),
A_TO_WORKSPACE = (1 << 1), A_TO_WORKSPACE = (1 << 1)
A_TO_OUTPUT = (1 << 2)
} type; } type;
/** the criteria to check if a window matches */ /** the criteria to check if a window matches */
Match match; Match match;
/** destination workspace/output/command, depending on the type */ /** destination workspace/command, depending on the type */
union { union {
char *command; char *command;
char *workspace; char *workspace;
char *output;
} dest; } dest;
TAILQ_ENTRY(Assignment) assignments; TAILQ_ENTRY(Assignment) assignments;

View File

@ -158,8 +158,6 @@ void load_configuration(xcb_connection_t *conn, const char *override_configpath,
assign = TAILQ_FIRST(&assignments); assign = TAILQ_FIRST(&assignments);
if (assign->type == A_TO_WORKSPACE) if (assign->type == A_TO_WORKSPACE)
FREE(assign->dest.workspace); FREE(assign->dest.workspace);
else if (assign->type == A_TO_OUTPUT)
FREE(assign->dest.output);
else if (assign->type == A_COMMAND) else if (assign->type == A_COMMAND)
FREE(assign->dest.command); FREE(assign->dest.command);
match_free(&(assign->match)); match_free(&(assign->match));

View File

@ -253,23 +253,20 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
/* See if any container swallows this new window */ /* See if any container swallows this new window */
nc = con_for_window(search_at, cwindow, &match); nc = con_for_window(search_at, cwindow, &match);
if (nc == NULL) { if (nc == NULL) {
/* If not, check if it is assigned to a specific workspace / output */ /* If not, check if it is assigned to a specific workspace */
if ((assignment = assignment_for(cwindow, A_TO_WORKSPACE | A_TO_OUTPUT))) { if ((assignment = assignment_for(cwindow, A_TO_WORKSPACE))) {
DLOG("Assignment matches (%p)\n", match); DLOG("Assignment matches (%p)\n", match);
if (assignment->type == A_TO_WORKSPACE) { Con *assigned_ws = workspace_get(assignment->dest.workspace, NULL);
Con *assigned_ws = workspace_get(assignment->dest.workspace, NULL); nc = con_descend_tiling_focused(assigned_ws);
nc = con_descend_tiling_focused(assigned_ws); DLOG("focused on ws %s: %p / %s\n", assigned_ws->name, nc, nc->name);
DLOG("focused on ws %s: %p / %s\n", assigned_ws->name, nc, nc->name); if (nc->type == CT_WORKSPACE)
if (nc->type == CT_WORKSPACE) nc = tree_open_con(nc, cwindow);
nc = tree_open_con(nc, cwindow); else
else nc = tree_open_con(nc->parent, cwindow);
nc = tree_open_con(nc->parent, cwindow);
/* set the urgency hint on the window if the workspace is not visible */ /* set the urgency hint on the window if the workspace is not visible */
if (!workspace_is_visible(assigned_ws)) if (!workspace_is_visible(assigned_ws))
urgency_hint = true; urgency_hint = true;
}
/* TODO: handle assignments with type == A_TO_OUTPUT */
} else if (startup_ws) { } else if (startup_ws) {
/* If its not assigned, but was started on a specific workspace, /* If its not assigned, but was started on a specific workspace,
* we want to open it there */ * we want to open it there */