From 4afbfac5285d964ba0d44e457609383288e4dc5a Mon Sep 17 00:00:00 2001 From: John Lindgren Date: Fri, 4 Jul 2025 00:40:15 -0400 Subject: [PATCH] src: put designated initializers in member order Out-of-order named initializers are allowed in C (unlike in C++) but are still surprising - I don't see a reason not to put them in order. --- src/edges.c | 6 +++--- src/input/ime.c | 6 +++--- src/ssd/ssd.c | 2 +- src/theme.c | 18 +++++++++--------- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/edges.c b/src/edges.c index 6d64c511..50b7e615 100644 --- a/src/edges.c +++ b/src/edges.c @@ -283,8 +283,8 @@ subtract_view_from_space(struct view *view, pixman_region32_t *available) struct wlr_box view_size = ssd_max_extents(view); pixman_box32_t view_rect = { .x1 = view_size.x, - .x2 = view_size.x + view_size.width, .y1 = view_size.y, + .x2 = view_size.x + view_size.width, .y2 = view_size.y + view_size.height }; @@ -431,10 +431,10 @@ edges_find_neighbors(struct border *nearest_edges, struct view *view, struct border win_edges = { .top = v->current.y - border.top, - .left = v->current.x - border.left, + .right = v->current.x + v->current.width + border.right, .bottom = v->current.y + border.bottom + view_effective_height(v, /* use_pending */ false), - .right = v->current.x + v->current.width + border.right, + .left = v->current.x - border.left, }; validate_edges(nearest_edges, view_edges, diff --git a/src/input/ime.c b/src/input/ime.c index ded28f5c..e76b2f2c 100644 --- a/src/input/ime.c +++ b/src/input/ime.c @@ -224,13 +224,13 @@ update_popup_position(struct input_method_popup *popup) .anchor_rect = cursor_rect, .anchor = XDG_POSITIONER_ANCHOR_BOTTOM_LEFT, .gravity = XDG_POSITIONER_GRAVITY_BOTTOM_RIGHT, + .constraint_adjustment = + XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y + | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X, .size = { .width = popup->popup_surface->surface->current.width, .height = popup->popup_surface->surface->current.height, }, - .constraint_adjustment = - XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_FLIP_Y - | XDG_POSITIONER_CONSTRAINT_ADJUSTMENT_SLIDE_X, }; struct wlr_box popup_box; diff --git a/src/ssd/ssd.c b/src/ssd/ssd.c index 65416ca3..48d416b9 100644 --- a/src/ssd/ssd.c +++ b/src/ssd/ssd.c @@ -46,9 +46,9 @@ ssd_thickness(struct view *view) struct border thickness = { .top = theme->titlebar_height + theme->border_width, + .right = theme->border_width, .bottom = theme->border_width, .left = theme->border_width, - .right = theme->border_width, }; if (view->ssd_titlebar_hidden) { diff --git a/src/theme.c b/src/theme.c index 5671c195..5fe9c1a2 100644 --- a/src/theme.c +++ b/src/theme.c @@ -289,49 +289,49 @@ load_buttons(struct theme *theme) { struct button buttons[] = { { .name = "menu", + .fallback_button = (const char[]){ 0x00, 0x21, 0x33, 0x1E, 0x0C, 0x00 }, .type = LAB_SSD_BUTTON_WINDOW_MENU, .state_set = 0, - .fallback_button = (const char[]){ 0x00, 0x21, 0x33, 0x1E, 0x0C, 0x00 }, }, { .name = "iconify", + .fallback_button = (const char[]){ 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f }, .type = LAB_SSD_BUTTON_ICONIFY, .state_set = 0, - .fallback_button = (const char[]){ 0x00, 0x00, 0x00, 0x00, 0x3f, 0x3f }, }, { .name = "max", + .fallback_button = (const char[]){ 0x3f, 0x3f, 0x21, 0x21, 0x21, 0x3f }, .type = LAB_SSD_BUTTON_MAXIMIZE, .state_set = 0, - .fallback_button = (const char[]){ 0x3f, 0x3f, 0x21, 0x21, 0x21, 0x3f }, }, { .name = "max_toggled", + .fallback_button = (const char[]){ 0x3e, 0x22, 0x2f, 0x29, 0x39, 0x0f }, .type = LAB_SSD_BUTTON_MAXIMIZE, .state_set = LAB_BS_TOGGLED, - .fallback_button = (const char[]){ 0x3e, 0x22, 0x2f, 0x29, 0x39, 0x0f }, }, { .name = "shade", + .fallback_button = (const char[]){ 0x3f, 0x3f, 0x00, 0x0c, 0x1e, 0x3f }, .type = LAB_SSD_BUTTON_SHADE, .state_set = 0, - .fallback_button = (const char[]){ 0x3f, 0x3f, 0x00, 0x0c, 0x1e, 0x3f }, }, { .name = "shade_toggled", + .fallback_button = (const char[]){ 0x3f, 0x3f, 0x00, 0x3f, 0x1e, 0x0c }, .type = LAB_SSD_BUTTON_SHADE, .state_set = LAB_BS_TOGGLED, - .fallback_button = (const char[]){ 0x3f, 0x3f, 0x00, 0x3f, 0x1e, 0x0c }, }, { .name = "desk", + .fallback_button = (const char[]){ 0x33, 0x33, 0x00, 0x00, 0x33, 0x33 }, .type = LAB_SSD_BUTTON_OMNIPRESENT, .state_set = 0, - .fallback_button = (const char[]){ 0x33, 0x33, 0x00, 0x00, 0x33, 0x33 }, }, { .name = "desk_toggled", + .fallback_button = (const char[]){ 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 }, .type = LAB_SSD_BUTTON_OMNIPRESENT, .state_set = LAB_BS_TOGGLED, - .fallback_button = (const char[]){ 0x00, 0x1e, 0x1a, 0x16, 0x1e, 0x00 }, }, { .name = "close", + .fallback_button = (const char[]){ 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 }, .type = LAB_SSD_BUTTON_CLOSE, .state_set = 0, - .fallback_button = (const char[]){ 0x33, 0x3f, 0x1e, 0x1e, 0x3f, 0x33 }, }, { .name = "menu_hover", .type = LAB_SSD_BUTTON_WINDOW_MENU, -- 2.52.0