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, const bool disable_randr15) |
We have just established a connection to the X server and need the initial XRandR information to setup workspaces for each screen. | |
void | output_init_con (Output *output) |
Initializes a CT_OUTPUT Con (searches existing ones from inplace restart before) to use for the given Output. | |
void | init_ws_for_output (Output *output) |
Initializes at least one workspace for this output, trying the following steps until there is at least one workspace: | |
void | randr_query_outputs (void) |
(Re-)queries the outputs via RandR and stores them in the list of outputs. | |
void | randr_disable_output (Output *output) |
Disables the output and moves its content. | |
Output * | get_first_output (void) |
Returns the first output which is active. | |
Output * | get_output_by_name (const char *name, const bool require_active) |
Returns the output with the given name or NULL. | |
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. | |
Output * | get_output_from_rect (Rect rect) |
Returns the active output which contains the midpoint of the given rect. | |
Output * | get_output_with_dimensions (Rect rect) |
Returns the active output which spans exactly the area specified by rect or NULL if there is no output like this. | |
Output * | output_containing_rect (Rect rect) |
In output_containing_rect, we check if any active output contains part of the container. | |
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. | |
Output * | get_output_next_wrap (direction_t direction, Output *current) |
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps. | |
Output * | create_root_output (xcb_connection_t *conn) |
Creates an output covering the root window. | |
Variables | |
struct outputs_head | outputs |
enum output_close_far_t |
Output * create_root_output | ( | xcb_connection_t * | conn | ) |
Creates an output covering the root window.
Definition at line 324 of file randr.c.
References xoutput::active, Rect::height, output_name::name, xoutput::rect, root_screen, scalloc(), SLIST_INIT, SLIST_INSERT_HEAD, Rect::width, Rect::x, and Rect::y.
Referenced by randr_init(), and use_root_output().
Output * get_first_output | ( | void | ) |
Returns the first output which is active.
Definition at line 80 of file randr.c.
References xoutput::active, die, outputs, xoutput::primary, and TAILQ_FOREACH.
Referenced by main(), and move_content().
Output * get_output_by_name | ( | const char * | name, |
const bool | require_active ) |
Returns the output with the given name or NULL.
If require_active is true, only active outputs are considered.
Definition at line 50 of file randr.c.
References xoutput::active, output_name::name, outputs, xoutput::primary, SLIST_FOREACH, and TAILQ_FOREACH.
Referenced by canonicalize_output_name(), get_assigned_output(), get_output_for_con(), get_output_from_string(), randr_query_outputs(), and randr_query_outputs_15().
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 122 of file randr.c.
References xoutput::active, DLOG, Rect::height, outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, Rect::y, and y.
Referenced by check_crossing_screen_boundary(), find_drop_target(), floating_move_to_pointer(), get_output_from_rect(), get_tree_next_workspace(), handle_configure_request(), main(), manage_window(), and x_push_changes().
Returns the active output which contains the midpoint of the given rect.
If such an output doesn't exist, returns the output which contains most of the rectangle or NULL if there is no output which intersects with it.
Definition at line 145 of file randr.c.
References get_output_containing(), Rect::height, output_containing_rect(), Rect::width, Rect::x, and Rect::y.
Referenced by floating_enable(), and floating_maybe_reassign_ws().
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 255 of file randr.c.
References xoutput::active, CLOSEST_OUTPUT, D_DOWN, D_LEFT, D_RIGHT, D_UP, DLOG, Rect::height, output_primary_name(), outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, and Rect::y.
Referenced by get_output_next_wrap(), get_tree_next_workspace(), 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 221 of file randr.c.
References CLOSEST_OUTPUT, D_DOWN, D_LEFT, D_RIGHT, D_UP, DLOG, FARTHEST_OUTPUT, get_output_next(), and output_primary_name().
Referenced by get_output_from_string().
Returns the active output which spans exactly the area specified by rect or NULL if there is no output like this.
Definition at line 158 of file randr.c.
References xoutput::active, DLOG, Rect::height, outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, and Rect::y.
Referenced by manage_window().
void init_ws_for_output | ( | Output * | output | ) |
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 455 of file randr.c.
References all_cons, CF_OUTPUT, xoutput::con, con_get_workspace(), con_is_internal(), create_workspace_on_output(), DLOG, focused, Con::fullscreen_mode, get_assigned_output(), get_output_for_con(), GREP_FIRST, LOG, Con::name, Workspace_Assignment::name, Con::num, Workspace_Assignment::output, output_get_content(), output_primary_name(), output_triggers_assignment(), Con::rect, TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, Con::type, workspace_move_to_output(), workspace_show(), workspace_show_by_name(), and ws_assignments.
Referenced by fake_outputs_init(), fallback_to_root_output(), query_screens(), randr_query_outputs(), and use_root_output().
In output_containing_rect, we check if any active output contains part of the container.
We do this by checking if the output rect is intersected by the Rect. This is the 2-dimensional counterpart of get_output_containing. Returns the output with the maximum intersecting area.
Definition at line 183 of file randr.c.
References xoutput::active, DLOG, Rect::height, max(), min(), outputs, xoutput::rect, TAILQ_FOREACH, Rect::width, Rect::x, and Rect::y.
Referenced by floating_reposition(), and get_output_from_rect().
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 346 of file randr.c.
References xoutput::con, con_attach(), con_fix_percent(), con_new(), croot, DLOG, Match::dock, focused, FREE, Match::insert_where, L_DOCKAREA, L_OUTPUT, L_SPLITH, Con::layout, match_init(), Con::name, output_name::name, output_primary_name(), Con::rect, xoutput::rect, sasprintf(), scalloc(), sstrdup(), TAILQ_FOREACH, TAILQ_INSERT_HEAD, TAILQ_INSERT_TAIL, TAILQ_REMOVE, Con::type, and x_set_name().
Referenced by fake_outputs_init(), fallback_to_root_output(), main(), query_screens(), randr_query_outputs(), and use_root_output().
void randr_disable_output | ( | Output * | output | ) |
Disables the output and moves its content.
Definition at line 1071 of file randr.c.
References xoutput::active, xoutput::changed, xoutput::con, DLOG, move_content(), output_primary_name(), and xoutput::to_be_disabled.
Referenced by main(), and randr_query_outputs().
void randr_init | ( | int * | event_base, |
const bool | disable_randr15 ) |
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 1099 of file randr.c.
References conn, create_root_output(), DLOG, ELOG, fallback_to_root_output(), has_randr_1_5, outputs, randr_query_outputs(), root, root_output, and TAILQ_INSERT_TAIL.
Referenced by main().
void randr_query_outputs | ( | void | ) |
(Re-)queries the outputs via RandR and stores them in the list of outputs.
Definition at line 933 of file randr.c.
References xoutput::active, any_randr_output_active(), xoutput::changed, xoutput::con, con_is_internal(), conn, croot, DLOG, ewmh_update_desktop_properties(), FREE, get_output_by_name(), Rect::height, init_ws_for_output(), min(), move_content(), Con::name, output_change_mode(), output_get_content(), output_init_con(), output_primary_name(), outputs, primary, xoutput::primary, randr_disable_output(), randr_query_outputs_14(), randr_query_outputs_15(), xoutput::rect, root_output, TAILQ_EMPTY, TAILQ_END, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_NEXT, xoutput::to_be_disabled, tree_render(), update_if_necessary(), Rect::width, workspace_show(), Rect::x, and Rect::y.
Referenced by handle_configure_notify(), handle_screen_change(), and randr_init().
TAILQ_HEAD | ( | outputs_head | , |
xoutput | ) |
|
extern |
Definition at line 22 of file randr.c.
Referenced by any_randr_output_active(), CFGFUN(), fake_outputs_init(), get_first_output(), get_output_by_id(), get_output_by_name(), get_output_containing(), get_output_next(), get_output_with_dimensions(), get_screen_at(), get_screen_at(), handle_output(), IPC_HANDLER(), main(), output_containing_rect(), query_screens(), randr_init(), randr_query_outputs(), randr_query_outputs_15(), sighandler_create_dialogs(), TAILQ_HEAD(), total_outputs_dimensions(), and use_root_output().