run clang-format (3.5.0)
Not quite sure why there are so many differences. Perhaps we’ve gotten out of the habit of running clang-format after every change. I guess it’d be best to have a travis hook that runs clang-format for us and reports any problems on pull requests.
This commit is contained in:
12
src/con.c
12
src/con.c
@ -1149,12 +1149,12 @@ Rect con_border_style_rect(Con *con) {
|
||||
/* Shortcut to avoid calling con_adjacent_borders() on dock containers. */
|
||||
int border_style = con_border_style(con);
|
||||
if (border_style == BS_NONE)
|
||||
return (Rect) {0, 0, 0, 0};
|
||||
return (Rect){0, 0, 0, 0};
|
||||
borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
|
||||
if (border_style == BS_NORMAL) {
|
||||
result = (Rect) {border_width, 0, -(2 * border_width), -(border_width)};
|
||||
result = (Rect){border_width, 0, -(2 * border_width), -(border_width)};
|
||||
} else {
|
||||
result = (Rect) {border_width, border_width, -(2 * border_width), -(2 * border_width)};
|
||||
result = (Rect){border_width, border_width, -(2 * border_width), -(2 * border_width)};
|
||||
}
|
||||
|
||||
/* Floating windows are never adjacent to any other window, so
|
||||
@ -1473,7 +1473,7 @@ Rect con_minimum_size(Con *con) {
|
||||
|
||||
if (con_is_leaf(con)) {
|
||||
DLOG("leaf node, returning 75x50\n");
|
||||
return (Rect) {0, 0, 75, 50};
|
||||
return (Rect){0, 0, 75, 50};
|
||||
}
|
||||
|
||||
if (con->type == CT_FLOATING_CON) {
|
||||
@ -1493,7 +1493,7 @@ Rect con_minimum_size(Con *con) {
|
||||
}
|
||||
DLOG("stacked/tabbed now, returning %d x %d + deco_rect = %d\n",
|
||||
max_width, max_height, deco_height);
|
||||
return (Rect) {0, 0, max_width, max_height + deco_height};
|
||||
return (Rect){0, 0, max_width, max_height + deco_height};
|
||||
}
|
||||
|
||||
/* For horizontal/vertical split containers we sum up the width (h-split)
|
||||
@ -1513,7 +1513,7 @@ Rect con_minimum_size(Con *con) {
|
||||
}
|
||||
}
|
||||
DLOG("split container, returning width = %d x height = %d\n", width, height);
|
||||
return (Rect) {0, 0, width, height};
|
||||
return (Rect){0, 0, width, height};
|
||||
}
|
||||
|
||||
ELOG("Unhandled case, type = %d, layout = %d, split = %d\n",
|
||||
|
@ -511,7 +511,7 @@ DRAGGING_CB(resize_window_callback) {
|
||||
dest_height = max(dest_height, (int)(dest_width / ratio));
|
||||
}
|
||||
|
||||
con->rect = (Rect) {dest_x, dest_y, dest_width, dest_height};
|
||||
con->rect = (Rect){dest_x, dest_y, dest_width, dest_height};
|
||||
|
||||
/* Obey window size */
|
||||
floating_check_size(con);
|
||||
|
@ -651,18 +651,18 @@ static void handle_expose_event(xcb_expose_event_t *event) {
|
||||
return;
|
||||
}
|
||||
|
||||
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
|
||||
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
|
||||
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
|
||||
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
|
||||
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
|
||||
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
|
||||
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
|
||||
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
|
||||
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
|
||||
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
|
||||
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
|
||||
#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
|
||||
#define _NET_WM_MOVERESIZE_SIZE_TOPLEFT 0
|
||||
#define _NET_WM_MOVERESIZE_SIZE_TOP 1
|
||||
#define _NET_WM_MOVERESIZE_SIZE_TOPRIGHT 2
|
||||
#define _NET_WM_MOVERESIZE_SIZE_RIGHT 3
|
||||
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMRIGHT 4
|
||||
#define _NET_WM_MOVERESIZE_SIZE_BOTTOM 5
|
||||
#define _NET_WM_MOVERESIZE_SIZE_BOTTOMLEFT 6
|
||||
#define _NET_WM_MOVERESIZE_SIZE_LEFT 7
|
||||
#define _NET_WM_MOVERESIZE_MOVE 8 /* movement only */
|
||||
#define _NET_WM_MOVERESIZE_SIZE_KEYBOARD 9 /* size via keyboard */
|
||||
#define _NET_WM_MOVERESIZE_MOVE_KEYBOARD 10 /* move via keyboard */
|
||||
#define _NET_WM_MOVERESIZE_CANCEL 11 /* cancel operation */
|
||||
|
||||
/*
|
||||
* Handle client messages (EWMH)
|
||||
|
@ -157,7 +157,7 @@ static void dump_binding(yajl_gen gen, Binding *bind) {
|
||||
y(integer, bind->keycode);
|
||||
|
||||
ystr("input_type");
|
||||
ystr((const char*)(bind->input_type == B_KEYBOARD ? "keyboard" : "mouse"));
|
||||
ystr((const char *)(bind->input_type == B_KEYBOARD ? "keyboard" : "mouse"));
|
||||
|
||||
ystr("symbol");
|
||||
if (bind->symbol == NULL)
|
||||
@ -397,7 +397,8 @@ void dump_node(yajl_gen gen, struct Con *con, bool inplace_restart) {
|
||||
ystr("transient_for");
|
||||
if (con->window->transient_for == XCB_NONE)
|
||||
y(null);
|
||||
else y(integer, con->window->transient_for);
|
||||
else
|
||||
y(integer, con->window->transient_for);
|
||||
|
||||
y(map_close);
|
||||
}
|
||||
|
@ -502,7 +502,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
xcb_void_cookie_t cookie;
|
||||
cookie = xcb_change_window_attributes_checked(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {ROOT_EVENT_MASK});
|
||||
cookie = xcb_change_window_attributes_checked(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK});
|
||||
check_error(conn, cookie, "Another window manager seems to be running");
|
||||
|
||||
xcb_get_geometry_reply_t *greply = xcb_get_geometry_reply(conn, gcookie, NULL);
|
||||
@ -742,10 +742,10 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
xcb_create_gc(conn, gc, root->root,
|
||||
XCB_GC_FUNCTION | XCB_GC_PLANE_MASK | XCB_GC_FILL_STYLE | XCB_GC_SUBWINDOW_MODE,
|
||||
(uint32_t[]) {XCB_GX_COPY, ~0, XCB_FILL_STYLE_SOLID, XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS});
|
||||
(uint32_t[]){XCB_GX_COPY, ~0, XCB_FILL_STYLE_SOLID, XCB_SUBWINDOW_MODE_INCLUDE_INFERIORS});
|
||||
|
||||
xcb_copy_area(conn, root->root, pixmap, gc, 0, 0, 0, 0, width, height);
|
||||
xcb_change_window_attributes_checked(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]) {pixmap});
|
||||
xcb_change_window_attributes_checked(conn, root->root, XCB_CW_BACK_PIXMAP, (uint32_t[]){pixmap});
|
||||
xcb_flush(conn);
|
||||
xcb_free_gc(conn, gc);
|
||||
xcb_free_pixmap(conn, pixmap);
|
||||
|
@ -69,7 +69,7 @@ void restore_geometry(void) {
|
||||
|
||||
/* Strictly speaking, this line doesn’t really belong here, but since we
|
||||
* are syncing, let’s un-register as a window manager first */
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
|
||||
|
||||
/* Make sure our changes reach the X server, we restart/exit now */
|
||||
xcb_aux_sync(conn);
|
||||
@ -434,7 +434,7 @@ void manage_window(xcb_window_t window, xcb_get_window_attributes_cookie_t cooki
|
||||
* which are not managed by the wm anyways). We store the original geometry
|
||||
* here because it’s used for dock clients. */
|
||||
if (nc->geometry.width == 0)
|
||||
nc->geometry = (Rect) {geom->x, geom->y, geom->width, geom->height};
|
||||
nc->geometry = (Rect){geom->x, geom->y, geom->width, geom->height};
|
||||
|
||||
if (motif_border_style != BS_NORMAL) {
|
||||
DLOG("MOTIF_WM_HINTS specifies decorations (border_style = %d)\n", motif_border_style);
|
||||
|
@ -154,7 +154,7 @@ void render_con(Con *con, bool render_fullscreen) {
|
||||
/* depending on the border style, the rect of the child window
|
||||
* needs to be smaller */
|
||||
Rect *inset = &(con->window_rect);
|
||||
*inset = (Rect) {0, 0, con->rect.width, con->rect.height};
|
||||
*inset = (Rect){0, 0, con->rect.width, con->rect.height};
|
||||
if (!render_fullscreen)
|
||||
*inset = rect_add(*inset, con_border_style_rect(con));
|
||||
|
||||
@ -299,7 +299,7 @@ void render_con(Con *con, bool render_fullscreen) {
|
||||
transient_con->window != NULL &&
|
||||
transient_con->window->transient_for != XCB_NONE) {
|
||||
DLOG("transient_con = 0x%08x, transient_con->window->transient_for = 0x%08x, fullscreen_id = 0x%08x\n",
|
||||
transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id);
|
||||
transient_con->window->id, transient_con->window->transient_for, fullscreen->window->id);
|
||||
if (transient_con->window->transient_for == fullscreen->window->id) {
|
||||
is_transient_for = true;
|
||||
break;
|
||||
|
@ -125,9 +125,9 @@ void restore_connect(void) {
|
||||
|
||||
static void update_placeholder_contents(placeholder_state *state) {
|
||||
xcb_change_gc(restore_conn, state->gc, XCB_GC_FOREGROUND,
|
||||
(uint32_t[]) {config.client.placeholder.background});
|
||||
(uint32_t[]){config.client.placeholder.background});
|
||||
xcb_poly_fill_rectangle(restore_conn, state->pixmap, state->gc, 1,
|
||||
(xcb_rectangle_t[]) {{0, 0, state->rect.width, state->rect.height}});
|
||||
(xcb_rectangle_t[]){{0, 0, state->rect.width, state->rect.height}});
|
||||
|
||||
// TODO: make i3font functions per-connection, at least these two for now…?
|
||||
xcb_flush(restore_conn);
|
||||
@ -190,7 +190,7 @@ static void open_placeholder_window(Con *con) {
|
||||
XCURSOR_CURSOR_POINTER,
|
||||
true,
|
||||
XCB_CW_BACK_PIXEL | XCB_CW_EVENT_MASK,
|
||||
(uint32_t[]) {
|
||||
(uint32_t[]){
|
||||
config.client.placeholder.background,
|
||||
XCB_EVENT_MASK_EXPOSURE | XCB_EVENT_MASK_STRUCTURE_NOTIFY,
|
||||
});
|
||||
@ -211,7 +211,7 @@ static void open_placeholder_window(Con *con) {
|
||||
xcb_create_pixmap(restore_conn, root_depth, state->pixmap,
|
||||
state->window, state->rect.width, state->rect.height);
|
||||
state->gc = xcb_generate_id(restore_conn);
|
||||
xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]) {0});
|
||||
xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]){0});
|
||||
update_placeholder_contents(state);
|
||||
TAILQ_INSERT_TAIL(&state_head, state, state);
|
||||
|
||||
@ -323,7 +323,7 @@ static void configure_notify(xcb_configure_notify_event_t *event) {
|
||||
xcb_create_pixmap(restore_conn, root_depth, state->pixmap,
|
||||
state->window, state->rect.width, state->rect.height);
|
||||
state->gc = xcb_generate_id(restore_conn);
|
||||
xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]) {0});
|
||||
xcb_create_gc(restore_conn, state->gc, state->pixmap, XCB_GC_GRAPHICS_EXPOSURES, (uint32_t[]){0});
|
||||
|
||||
update_placeholder_contents(state);
|
||||
xcb_copy_area(restore_conn, state->pixmap, state->window, state->gc,
|
||||
|
@ -129,9 +129,9 @@ static int sig_draw_window(xcb_window_t win, int width, int height, int font_hei
|
||||
/* re-draw the background */
|
||||
xcb_rectangle_t border = {0, 0, width, height},
|
||||
inner = {2, 2, width - 4, height - 4};
|
||||
xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#FF0000")});
|
||||
xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#FF0000")});
|
||||
xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &border);
|
||||
xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]) {get_colorpixel("#000000")});
|
||||
xcb_change_gc(conn, pixmap_gc, XCB_GC_FOREGROUND, (uint32_t[]){get_colorpixel("#000000")});
|
||||
xcb_poly_fill_rectangle(conn, pixmap, pixmap_gc, 1, &inner);
|
||||
|
||||
/* restore font color */
|
||||
|
@ -76,7 +76,7 @@ bool tree_restore(const char *path, xcb_get_geometry_reply_t *geometry) {
|
||||
|
||||
/* TODO: refactor the following */
|
||||
croot = con_new(NULL, NULL);
|
||||
croot->rect = (Rect) {
|
||||
croot->rect = (Rect){
|
||||
geometry->x,
|
||||
geometry->y,
|
||||
geometry->width,
|
||||
@ -118,7 +118,7 @@ void tree_init(xcb_get_geometry_reply_t *geometry) {
|
||||
croot->name = "root";
|
||||
croot->type = CT_ROOT;
|
||||
croot->layout = L_SPLITH;
|
||||
croot->rect = (Rect) {
|
||||
croot->rect = (Rect){
|
||||
geometry->x,
|
||||
geometry->y,
|
||||
geometry->width,
|
||||
@ -237,7 +237,7 @@ bool tree_close(Con *con, kill_window_t kill_window, bool dont_kill_parent, bool
|
||||
* unmap the window,
|
||||
* then reparent it to the root window. */
|
||||
xcb_change_window_attributes(conn, con->window->id,
|
||||
XCB_CW_EVENT_MASK, (uint32_t[]) {XCB_NONE});
|
||||
XCB_CW_EVENT_MASK, (uint32_t[]){XCB_NONE});
|
||||
xcb_unmap_window(conn, con->window->id);
|
||||
cookie = xcb_reparent_window(conn, con->window->id, root, 0, 0);
|
||||
|
||||
|
16
src/util.c
16
src/util.c
@ -42,17 +42,17 @@ bool rect_contains(Rect rect, uint32_t x, uint32_t y) {
|
||||
}
|
||||
|
||||
Rect rect_add(Rect a, Rect b) {
|
||||
return (Rect) {a.x + b.x,
|
||||
a.y + b.y,
|
||||
a.width + b.width,
|
||||
a.height + b.height};
|
||||
return (Rect){a.x + b.x,
|
||||
a.y + b.y,
|
||||
a.width + b.width,
|
||||
a.height + b.height};
|
||||
}
|
||||
|
||||
Rect rect_sub(Rect a, Rect b) {
|
||||
return (Rect) {a.x - b.x,
|
||||
a.y - b.y,
|
||||
a.width - b.width,
|
||||
a.height - b.height};
|
||||
return (Rect){a.x - b.x,
|
||||
a.y - b.y,
|
||||
a.width - b.width,
|
||||
a.height - b.height};
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -189,7 +189,7 @@ void window_update_strut_partial(i3Window *win, xcb_get_property_reply_t *prop)
|
||||
DLOG("Reserved pixels changed to: left = %d, right = %d, top = %d, bottom = %d\n",
|
||||
strut[0], strut[1], strut[2], strut[3]);
|
||||
|
||||
win->reserved = (struct reservedpx) {strut[0], strut[1], strut[2], strut[3]};
|
||||
win->reserved = (struct reservedpx){strut[0], strut[1], strut[2], strut[3]};
|
||||
|
||||
free(prop);
|
||||
}
|
||||
|
36
src/x.c
36
src/x.c
@ -352,8 +352,8 @@ void x_draw_decoration(Con *con) {
|
||||
|
||||
Rect *r = &(con->rect);
|
||||
Rect *w = &(con->window_rect);
|
||||
p->con_rect = (struct width_height) {r->width, r->height};
|
||||
p->con_window_rect = (struct width_height) {w->width, w->height};
|
||||
p->con_rect = (struct width_height){r->width, r->height};
|
||||
p->con_window_rect = (struct width_height){w->width, w->height};
|
||||
p->con_deco_rect = con->deco_rect;
|
||||
p->background = config.client.background;
|
||||
p->con_is_leaf = con_is_leaf(con);
|
||||
@ -403,7 +403,7 @@ void x_draw_decoration(Con *con) {
|
||||
);
|
||||
#endif
|
||||
|
||||
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {config.client.background});
|
||||
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){config.client.background});
|
||||
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, sizeof(background) / sizeof(xcb_rectangle_t), background);
|
||||
}
|
||||
|
||||
@ -424,7 +424,7 @@ void x_draw_decoration(Con *con) {
|
||||
* (left, bottom and right part). We don’t just fill the whole
|
||||
* rectangle because some childs are not freely resizable and we want
|
||||
* their background color to "shine through". */
|
||||
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->background});
|
||||
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->background});
|
||||
if (!(borders_to_hide & ADJ_LEFT_SCREEN_EDGE)) {
|
||||
xcb_rectangle_t leftline = {0, 0, br.x, r->height};
|
||||
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, &leftline);
|
||||
@ -450,12 +450,12 @@ void x_draw_decoration(Con *con) {
|
||||
if (TAILQ_NEXT(con, nodes) == NULL &&
|
||||
TAILQ_PREV(con, nodes_head, nodes) == NULL &&
|
||||
con->parent->type != CT_FLOATING_CON) {
|
||||
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->indicator});
|
||||
xcb_change_gc(conn, con->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->indicator});
|
||||
if (p->parent_layout == L_SPLITH)
|
||||
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]) {
|
||||
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
|
||||
{r->width + (br.width + br.x), br.y, -(br.width + br.x), r->height + br.height}});
|
||||
else if (p->parent_layout == L_SPLITV)
|
||||
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]) {
|
||||
xcb_poly_fill_rectangle(conn, con->pixmap, con->pm_gc, 1, (xcb_rectangle_t[]){
|
||||
{br.x, r->height + (br.height + br.y), r->width + br.width, -(br.height + br.y)}});
|
||||
}
|
||||
}
|
||||
@ -466,20 +466,20 @@ void x_draw_decoration(Con *con) {
|
||||
goto copy_pixmaps;
|
||||
|
||||
/* 4: paint the bar */
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->background});
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->background});
|
||||
xcb_rectangle_t drect = {con->deco_rect.x, con->deco_rect.y, con->deco_rect.width, con->deco_rect.height};
|
||||
xcb_poly_fill_rectangle(conn, parent->pixmap, parent->pm_gc, 1, &drect);
|
||||
|
||||
/* 5: draw two unconnected horizontal lines in border color */
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border});
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->border});
|
||||
Rect *dr = &(con->deco_rect);
|
||||
adjacent_t borders_to_hide = con_adjacent_borders(con) & config.hide_edge_borders;
|
||||
int deco_diff_l = borders_to_hide & ADJ_LEFT_SCREEN_EDGE ? 0 : con->current_border_width;
|
||||
int deco_diff_r = borders_to_hide & ADJ_RIGHT_SCREEN_EDGE ? 0 : con-> current_border_width;
|
||||
int deco_diff_r = borders_to_hide & ADJ_RIGHT_SCREEN_EDGE ? 0 : con->current_border_width;
|
||||
if (parent->layout == L_TABBED ||
|
||||
(parent->layout == L_STACKED && TAILQ_NEXT(con, nodes) != NULL)) {
|
||||
deco_diff_l = 0;
|
||||
deco_diff_r = 0;
|
||||
deco_diff_l = 0;
|
||||
deco_diff_r = 0;
|
||||
}
|
||||
xcb_segment_t segments[] = {
|
||||
{dr->x, dr->y,
|
||||
@ -545,12 +545,12 @@ after_title:
|
||||
/* Draw a 1px separator line before and after every tab, so that tabs can
|
||||
* be easily distinguished. */
|
||||
if (parent->layout == L_TABBED) {
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border});
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->border});
|
||||
} else {
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->background});
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->background});
|
||||
}
|
||||
xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, parent->pixmap, parent->pm_gc, 6,
|
||||
(xcb_point_t[]) {
|
||||
(xcb_point_t[]){
|
||||
{dr->x + dr->width, dr->y},
|
||||
{dr->x + dr->width, dr->y + dr->height},
|
||||
{dr->x + dr->width - 1, dr->y},
|
||||
@ -559,7 +559,7 @@ after_title:
|
||||
{dr->x, dr->y},
|
||||
});
|
||||
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]) {p->color->border});
|
||||
xcb_change_gc(conn, parent->pm_gc, XCB_GC_FOREGROUND, (uint32_t[]){p->color->border});
|
||||
xcb_poly_segment(conn, parent->pixmap, parent->pm_gc, 2, segments);
|
||||
|
||||
copy_pixmaps:
|
||||
@ -975,9 +975,9 @@ void x_push_changes(Con *con) {
|
||||
Output *target = get_output_containing(mid_x, mid_y);
|
||||
if (current != target) {
|
||||
/* Ignore MotionNotify events generated by warping */
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT});
|
||||
xcb_warp_pointer(conn, XCB_NONE, root, 0, 0, 0, 0, mid_x, mid_y);
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]) {ROOT_EVENT_MASK});
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_EVENT_MASK, (uint32_t[]){ROOT_EVENT_MASK});
|
||||
}
|
||||
}
|
||||
warp_to = NULL;
|
||||
|
@ -70,9 +70,9 @@ xcb_window_t create_window(xcb_connection_t *conn, Rect dims,
|
||||
*/
|
||||
void xcb_draw_line(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc,
|
||||
uint32_t colorpixel, uint32_t x, uint32_t y, uint32_t to_x, uint32_t to_y) {
|
||||
xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]) {colorpixel});
|
||||
xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){colorpixel});
|
||||
xcb_poly_line(conn, XCB_COORD_MODE_ORIGIN, drawable, gc, 2,
|
||||
(xcb_point_t[]) {{x, y}, {to_x, to_y}});
|
||||
(xcb_point_t[]){{x, y}, {to_x, to_y}});
|
||||
}
|
||||
|
||||
/*
|
||||
@ -81,7 +81,7 @@ void xcb_draw_line(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext
|
||||
*/
|
||||
void xcb_draw_rect(xcb_connection_t *conn, xcb_drawable_t drawable, xcb_gcontext_t gc,
|
||||
uint32_t colorpixel, uint32_t x, uint32_t y, uint32_t width, uint32_t height) {
|
||||
xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]) {colorpixel});
|
||||
xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, (uint32_t[]){colorpixel});
|
||||
xcb_rectangle_t rect = {x, y, width, height};
|
||||
xcb_poly_fill_rectangle(conn, drawable, gc, 1, &rect);
|
||||
}
|
||||
|
@ -56,7 +56,7 @@ void xcursor_load_cursors(void) {
|
||||
*/
|
||||
void xcursor_set_root_cursor(int cursor_id) {
|
||||
xcb_change_window_attributes(conn, root, XCB_CW_CURSOR,
|
||||
(uint32_t[]) {xcursor_get_cursor(cursor_id)});
|
||||
(uint32_t[]){xcursor_get_cursor(cursor_id)});
|
||||
}
|
||||
|
||||
xcb_cursor_t xcursor_get_cursor(enum xcursor_cursor_t c) {
|
||||
|
Reference in New Issue
Block a user