Implement special value 'current' for output. (#2483)
This commit introduces the special 'current' value for outputs in both of * move con to output current * move workspace to output current fixes #2357
This commit is contained in:
committed by
Michael Stapelberg
parent
6a8fb69eff
commit
c71f6f8f7c
@ -87,17 +87,6 @@ static bool definitelyGreaterThan(float a, float b, float epsilon) {
|
||||
return (a - b) > ((fabs(a) < fabs(b) ? fabs(b) : fabs(a)) * epsilon);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the output containing the given container.
|
||||
*/
|
||||
static Output *get_output_of_con(Con *con) {
|
||||
Con *output_con = con_get_output(con);
|
||||
Output *output = get_output_by_name(output_con->name);
|
||||
assert(output != NULL);
|
||||
|
||||
return output;
|
||||
}
|
||||
|
||||
/*
|
||||
* Checks whether we switched to a new workspace and returns false in that case,
|
||||
* signaling that further workspace switching should be done by the calling function
|
||||
@ -1036,7 +1025,7 @@ void cmd_move_con_to_output(I3_CMD, const char *name) {
|
||||
TAILQ_FOREACH(current, &owindows, owindows) {
|
||||
DLOG("matching: %p / %s\n", current->con, current->con->name);
|
||||
|
||||
Output *current_output = get_output_of_con(current->con);
|
||||
Output *current_output = get_output_for_con(current->con);
|
||||
assert(current_output != NULL);
|
||||
|
||||
Output *output = get_output_from_string(current_output, name);
|
||||
@ -1648,7 +1637,7 @@ void cmd_focus_output(I3_CMD, const char *name) {
|
||||
Output *output;
|
||||
|
||||
TAILQ_FOREACH(current, &owindows, owindows)
|
||||
current_output = get_output_of_con(current->con);
|
||||
current_output = get_output_for_con(current->con);
|
||||
assert(current_output != NULL);
|
||||
|
||||
output = get_output_from_string(current_output, name);
|
||||
|
Reference in New Issue
Block a user