i3
randr.h
Go to the documentation of this file.
1/*
2 * vim:ts=4:sw=4:expandtab
3 *
4 * i3 - an improved tiling window manager
5 * © 2009 Michael Stapelberg and contributors (see also: LICENSE)
6 *
7 * For more information on RandR, please see the X.org RandR specification at
8 * https://cgit.freedesktop.org/xorg/proto/randrproto/tree/randrproto.txt
9 * (take your time to read it completely, it answers all questions).
10 *
11 */
12#pragma once
13
14#include <config.h>
15
16#include "data.h"
17#include <xcb/randr.h>
18
19TAILQ_HEAD(outputs_head, xoutput);
20extern struct outputs_head outputs;
21
26
32void randr_init(int *event_base, const bool disable_randr15);
33
39void output_init_con(Output *output);
40
51void init_ws_for_output(Output *output);
52
57void randr_query_outputs(void);
58
63void randr_disable_output(Output *output);
64
70
76Output *get_output_by_name(const char *name, const bool require_active);
77
83Output *get_output_containing(unsigned int x, unsigned int y);
84
92
99
108
120Output *get_output_next(direction_t direction, Output *current, output_close_far_t close_far);
121
132Output *get_output_next_wrap(direction_t direction, Output *current);
133
138Output *create_root_output(xcb_connection_t *conn);
#define y(x,...)
Definition commands.c:18
xcb_connection_t * conn
XCB connection and root screen.
Definition main.c:54
direction_t
Definition data.h:56
#define TAILQ_HEAD(name, type)
Definition queue.h:318
Output * get_output_by_name(const char *name, const bool require_active)
Returns the output with the given name or NULL.
Definition randr.c:50
Output * get_output_from_rect(Rect rect)
Returns the active output which contains the midpoint of the given rect.
Definition randr.c:145
Output * output_containing_rect(Rect rect)
In output_containing_rect, we check if any active output contains part of the container.
Definition randr.c:183
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 outpu...
Definition randr.c:158
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...
Definition randr.c:122
void init_ws_for_output(Output *output)
Initializes at least one workspace for this output, trying the following steps until there is at leas...
Definition randr.c:455
void randr_query_outputs(void)
(Re-)queries the outputs via RandR and stores them in the list of outputs.
Definition randr.c:933
Output * get_output_next_wrap(direction_t direction, Output *current)
Like get_output_next with close_far == CLOSEST_OUTPUT, but wraps.
Definition randr.c:221
void output_init_con(Output *output)
Initializes a CT_OUTPUT Con (searches existing ones from inplace restart before) to use for the given...
Definition randr.c:346
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.
Definition randr.c:255
struct outputs_head outputs
Definition randr.c:22
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 setu...
Definition randr.c:1099
Output * create_root_output(xcb_connection_t *conn)
Creates an output covering the root window.
Definition randr.c:324
Output * get_first_output(void)
Returns the first output which is active.
Definition randr.c:80
output_close_far_t
Definition randr.h:22
@ FARTHEST_OUTPUT
Definition randr.h:24
@ CLOSEST_OUTPUT
Definition randr.h:23
void randr_disable_output(Output *output)
Disables the output and moves its content.
Definition randr.c:1071
Stores a rectangle, for example the size of a window, the child window etc.
Definition data.h:185
An Output is a physical output on your graphics driver.
Definition data.h:391