i3
|
Go to the source code of this file.
Enumerations | |
enum | output_close_far_t { CLOSEST_OUTPUT = 0, FARTHEST_OUTPUT = 1 } |
Functions | |
TAILQ_HEAD (outputs_head, xoutput) | |
void | randr_init (int *event_base) |
We have just established a connection to the X server and need the initial XRandR information to setup workspaces for each screen. More... | |
void | disable_randr (xcb_connection_t *conn) |
Disables RandR support by creating exactly one output with the size of the X11 screen. More... | |
void | output_init_con (Output *output) |
Initializes a CT_OUTPUT Con (searches existing ones from inplace restart before) to use for the given Output. More... | |
void | init_ws_for_output (Output *output, Con *content) |
Initializes at least one workspace for this output, trying the following steps until there is at least one workspace: More... | |
void | randr_query_outputs (void) |
Initializes the specified output, assigning the specified workspace to it. More... | |
Output * | get_first_output (void) |
Returns the first output which is active. More... | |
Output * | get_output_by_name (const char *name) |
Returns the output with the given name if it is active (!) or NULL. More... | |
Output * | get_output_containing (unsigned int x, unsigned int y) |
Returns the active (!) output which contains the coordinates x, y or NULL if there is no output which contains these coordinates. More... | |
bool | contained_by_output (Rect rect) |
Output * | get_output_next (direction_t direction, Output *current, output_close_far_t close_far) |
Gets the output which is the next one in the given direction. More... | |
Output * | get_output_next_wrap (direction_t direction, Output *current) |
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps. More... | |
Variables | |
struct outputs_head | outputs |
enum output_close_far_t |
bool contained_by_output | ( | Rect | rect | ) |
Definition at line 103 of file randr.c.
References xoutput::active, DLOG, Rect::height, outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, and Rect::y.
Referenced by floating_reposition().
void disable_randr | ( | xcb_connection_t * | conn | ) |
Disables RandR support by creating exactly one output with the size of the X11 screen.
Definition at line 227 of file randr.c.
References xoutput::active, xoutput::con, DLOG, Rect::height, init_ws_for_output(), xoutput::name, output_get_content(), output_init_con(), outputs, randr_disabled, xoutput::rect, root_screen, scalloc(), TAILQ_INSERT_TAIL, Rect::width, Rect::x, and Rect::y.
Referenced by randr_init(), randr_query_outputs(), and xinerama_init().
Output* get_first_output | ( | void | ) |
Returns the first output which is active.
Definition at line 65 of file randr.c.
References xoutput::active, die, outputs, and TAILQ_FOREACH.
Referenced by main(), and randr_query_outputs().
Output* get_output_by_name | ( | const char * | name | ) |
Returns the output with the given name if it is active (!) or NULL.
Definition at line 51 of file randr.c.
References xoutput::active, xoutput::name, outputs, and TAILQ_FOREACH.
Referenced by cmd_move_con_to_output(), get_output_from_string(), get_output_of_con(), init_ws_for_output(), and move_to_output_directed().
Output* get_output_containing | ( | unsigned int | x, |
unsigned int | y | ||
) |
Returns the active (!) output which contains the coordinates x, y or NULL if there is no output which contains these coordinates.
Definition at line 80 of file randr.c.
References xoutput::active, DLOG, Rect::height, outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, and Rect::y.
Referenced by _tree_next(), check_crossing_screen_boundary(), floating_enable(), floating_maybe_reassign_ws(), main(), manage_window(), and x_push_changes().
Output* get_output_next | ( | direction_t | direction, |
Output * | current, | ||
output_close_far_t | close_far | ||
) |
Gets the output which is the next one in the given direction.
If close_far == CLOSEST_OUTPUT, then the output next to the current one will selected. If close_far == FARTHEST_OUTPUT, the output which is the last one in the given direction will be selected.
NULL will be returned when no active outputs are present in the direction specified (note that ‘current’ counts as such an output).
Definition at line 161 of file randr.c.
References xoutput::active, CLOSEST_OUTPUT, D_DOWN, D_LEFT, D_RIGHT, D_UP, DLOG, Rect::height, xoutput::name, outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, and Rect::y.
Referenced by _tree_next(), get_output_next_wrap(), and move_to_output_directed().
Output* get_output_next_wrap | ( | direction_t | direction, |
Output * | current | ||
) |
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
For example if get_output_next(D_DOWN, x, FARTHEST_OUTPUT) = NULL, then get_output_next_wrap(D_DOWN, x) will return the topmost output.
This function always returns a output: if no active outputs can be found, current itself is returned.
Definition at line 129 of file randr.c.
References CLOSEST_OUTPUT, D_DOWN, D_LEFT, D_RIGHT, D_UP, DLOG, FARTHEST_OUTPUT, get_output_next(), and xoutput::name.
Referenced by cmd_move_con_to_output(), and get_output_from_string().
Initializes at least one workspace for this output, trying the following steps until there is at least one workspace:
• Move existing workspaces, which are assigned to be on the given output, to the output. • Create the first assigned workspace for this output. • Create the first unused workspace.
Definition at line 355 of file randr.c.
References CF_OUTPUT, xoutput::con, con_attach(), con_detach(), con_focus(), con_get_output(), create_workspace_on_output(), croot, DLOG, floating_fix_coordinates(), focused, Con::fullscreen_mode, get_output_by_name(), GREP_FIRST, init_ws_for_output(), LOG, Workspace_Assignment::name, xoutput::name, Con::name, Workspace_Assignment::output, output_get_content(), Con::rect, render_con(), TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_NEXT, workspace_is_visible(), workspace_show(), workspace_show_by_name(), and ws_assignments.
Referenced by disable_randr(), fake_outputs_init(), init_ws_for_output(), query_screens(), and randr_query_outputs().
void output_init_con | ( | Output * | output | ) |
Initializes a CT_OUTPUT Con (searches existing ones from inplace restart before) to use for the given Output.
Definition at line 251 of file randr.c.
References xoutput::con, con_attach(), con_fix_percent(), con_new(), croot, DLOG, Match::dock, FREE, Match::insert_where, L_DOCKAREA, L_OUTPUT, L_SPLITH, Con::layout, match_init(), xoutput::name, Con::name, xoutput::rect, Con::rect, sasprintf(), scalloc(), sstrdup(), TAILQ_FOREACH, TAILQ_INSERT_TAIL, Con::type, and x_set_name().
Referenced by disable_randr(), fake_outputs_init(), query_screens(), and randr_query_outputs().
void randr_init | ( | int * | event_base | ) |
We have just established a connection to the X server and need the initial XRandR information to setup workspaces for each screen.
Definition at line 822 of file randr.c.
References conn, disable_randr(), randr_query_outputs(), and root.
Referenced by main().
void randr_query_outputs | ( | void | ) |
Initializes the specified output, assigning the specified workspace to it.
(Re-)queries the outputs via RandR and stores them in the list of outputs.
Definition at line 592 of file randr.c.
References xoutput::active, xoutput::changed, xoutput::con, con_attach(), con_descend_focused(), con_detach(), con_focus(), con_for_window(), con_get_workspace(), conn, croot, disable_randr(), DLOG, DONT_KILL_WINDOW, ELOG, floating_fix_coordinates(), focused, FREE, get_first_output(), handle_output(), height, Rect::height, init_ws_for_output(), min(), xoutput::name, Con::name, Workspace_Assignment::output, output_change_mode(), output_get_content(), output_init_con(), outputs, primary, xoutput::primary, randr_disabled, xoutput::rect, Con::rect, root, TAILQ_EMPTY, TAILQ_END, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_NEXT, xoutput::to_be_disabled, tree_close(), tree_render(), Con::type, update_if_necessary(), width, Rect::width, Con::window, workspace_show(), Rect::x, and Rect::y.
Referenced by handle_screen_change(), and randr_init().
TAILQ_HEAD | ( | outputs_head | , |
xoutput | |||
) |
struct outputs_head outputs |
Definition at line 28 of file randr.c.
Referenced by contained_by_output(), disable_randr(), fake_outputs_init(), get_first_output(), get_output_by_id(), get_output_by_name(), get_output_containing(), get_output_next(), get_screen_at(), handle_output(), IPC_HANDLER(), open_popups(), query_screens(), randr_query_outputs(), total_outputs_dimensions(), and xinerama_init().