i3
Functions | Variables
include/randr.h File Reference
#include "data.h"
#include <xcb/randr.h>
Include dependency graph for randr.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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.
void disable_randr (xcb_connection_t *conn)
 Disables RandR support by creating exactly one output with the size of the X11 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, Con *content)
 Initializes at least one workspace for this output, trying the following steps until there is at least one workspace:
void randr_query_outputs ()
 Initializes the specified output, assigning the specified workspace to it.
Outputget_first_output ()
 Returns the first output which is active.
Outputget_output_by_name (const char *name)
 Returns the output with the given name if it is active (!) or NULL.
Outputget_output_containing (int x, int y)
 Returns the active (!) output which contains the coordinates x, y or NULL if there is no output which contains these coordinates.
Outputget_output_most (direction_t direction, Output *current)
 Gets the output which is the last one in the given direction, for example the output on the most bottom when direction == D_DOWN, the output most right when direction == D_RIGHT and so on.
Outputget_output_next (direction_t direction, Output *current)
 Gets the output which is the next one in the given direction.

Variables

struct outputs_head outputs

Function Documentation

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 192 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().

Here is the call graph for this function:

Returns the first output which is active.

Definition at line 63 of file randr.c.

References xoutput::active, 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 49 of file randr.c.

References xoutput::active, xoutput::name, outputs, and TAILQ_FOREACH.

Referenced by init_ws_for_output().

Output* get_output_containing ( int  x,
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 78 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(), floating_reposition(), main(), manage_window(), and x_push_changes().

Output* get_output_most ( direction_t  direction,
Output current 
)

Gets the output which is the last one in the given direction, for example the output on the most bottom when direction == D_DOWN, the output most right when direction == D_RIGHT and so on.

This function always returns a output.

Definition at line 101 of file randr.c.

References xoutput::active, D_DOWN, D_LEFT, D_RIGHT, D_UP, outputs, xoutput::rect, TAILQ_FOREACH, WIN, Rect::x, and Rect::y.

Output* get_output_next ( direction_t  direction,
Output current 
)

Gets the output which is the next one in the given direction.

Definition at line 145 of file randr.c.

References xoutput::active, D_DOWN, D_LEFT, D_RIGHT, D_UP, outputs, xoutput::rect, TAILQ_FOREACH, Rect::x, and Rect::y.

Referenced by _tree_next().

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:

• 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 321 of file randr.c.

References bindings, Binding::command, xoutput::con, con_attach(), con_detach(), con_focus(), con_get_output(), con_new(), config, croot, Config::default_orientation, DLOG, focused, FREE, Con::fullscreen_mode, get_output_by_name(), GREP_FIRST, Rect::height, HORIZ, init_ws_for_output(), LOG, Workspace_Assignment::name, xoutput::name, Con::name, NO_ORIENTATION, Con::num, Con::orientation, Workspace_Assignment::output, output_get_content(), xoutput::rect, sasprintf(), TAILQ_EMPTY, TAILQ_FIRST, TAILQ_FOREACH, TAILQ_NEXT, Con::type, VERT, Rect::width, workspace_is_visible(), workspace_show(), workspace_show_by_name(), ws_assignments, and x_set_name().

Referenced by disable_randr(), init_ws_for_output(), query_screens(), and randr_query_outputs().

Here is the call graph for this function:

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 216 of file randr.c.

References xoutput::con, con_attach(), con_fix_percent(), con_new(), croot, DLOG, Match::dock, FREE, Match::insert_where, Con::layout, match_init(), xoutput::name, Con::name, Con::orientation, xoutput::rect, Con::rect, sasprintf(), scalloc(), sstrdup(), TAILQ_FOREACH, TAILQ_INSERT_TAIL, Con::type, VERT, and x_set_name().

Referenced by disable_randr(), query_screens(), and randr_query_outputs().

Here is the call graph for this function:

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 849 of file randr.c.

References conn, disable_randr(), randr_query_outputs(), and root.

Referenced by main().

Here is the call graph for this function:

TAILQ_HEAD ( outputs_head  ,
xoutput   
)

Variable Documentation

struct outputs_head outputs