39 const char *walk = output_spec;
40 unsigned int x,
y, width, height;
42 while (sscanf(walk,
"%ux%u+%u+%u%n", &width, &height, &x, &
y, &chars_consumed) == 4) {
43 walk += chars_consumed;
51 DLOG(
"Parsed output as width = %u, height = %u at (%u, %u)%s\n",
52 width, height, x,
y,
primary ?
" (primary)" :
"");
55 if (new_output != NULL) {
56 DLOG(
"Re-used old output %p\n", new_output);
59 new_output->rect.width =
min(new_output->rect.width, width);
60 new_output->rect.height =
min(new_output->rect.height, height);
68 new_output->active =
true;
69 new_output->rect.x = x;
70 new_output->rect.y =
y;
71 new_output->rect.width = width;
72 new_output->rect.height = height;
74 if (new_output->rect.x == 0 && new_output->rect.y == 0)
86 ELOG(
"No screens found. Please fix your setup. i3 will exit now.\n");
void init_ws_for_output(Output *output)
Initializes at least one workspace for this output, trying the following steps until there is at leas...
void output_init_con(Output *output)
Initializes a CT_OUTPUT Con (searches existing ones from inplace restart before) to use for the given...
struct outputs_head outputs
xcb_randr_get_output_primary_reply_t * primary
char * output_primary_name(Output *output)
Retrieves the primary name of an output.
static Output * get_screen_at(unsigned int x, unsigned int y)
void fake_outputs_init(const char *output_spec)
Creates outputs according to the given specification.
#define TAILQ_FOREACH(var, head, field)
#define SLIST_INSERT_HEAD(head, elm, field)
#define TAILQ_INSERT_TAIL(head, elm, field)
#define TAILQ_INSERT_HEAD(head, elm, field)
void * scalloc(size_t num, size_t size)
Safe-wrapper around calloc which exits if malloc returns NULL (meaning that there is no more memory a...
int sasprintf(char **strp, const char *fmt,...)
Safe-wrapper around asprintf which exits if it returns -1 (meaning that there is no more memory avail...
An Output is a physical output on your graphics driver.
Rect rect
x, y, width, height