Skip to content

Commit 7a64b89

Browse files
committed
chore: even more refactoring
1 parent 5446f64 commit 7a64b89

10 files changed

Lines changed: 5 additions & 92 deletions

File tree

include/effects_backend.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ struct wlr_output_state;
1313
#define BLUR_MAX_LEVELS 10
1414

1515
typedef struct {
16-
struct wlr_buffer *buf;
1716
uint64_t native_handle[2];
1817
int width, height;
1918
} be_buffer_t;
@@ -38,7 +37,6 @@ struct be_blur_params {
3837
enum blur_algorithm algorithm;
3938
int passes;
4039
float radius;
41-
int downsample;
4240
float vibrancy, vibrancy_darkness;
4341
float noise_strength;
4442
float brightness;

include/input.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,5 @@ void input_apply_config(struct wlr_input_device *device);
9494
void input_apply_config_all_keyboards(void);
9595
void input_apply_config_all_pointers(void);
9696

97-
const char *input_config_type_str(enum input_config_type type);
98-
9997
extern input_config_t *input_configs[MAX_INPUT_CONFIGS];
10098
extern size_t num_input_configs;

include/ipc.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@ void ipc_init(void);
5151
int ipc_get_socket_fd(void);
5252
void ipc_handle_incoming(int client_fd);
5353
void ipc_fini(void);
54-
const char *ipc_get_socket_path(void);
5554

5655
void ipc_put_status(subscriber_mask_t mask, const char *fmt, ...);
5756
bool ipc_print_report(int fd);

include/tree.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ node_t *prev_leaf(node_t *n, node_t *r);
5252
bool focus_node(struct output_t *m, desktop_t *d, node_t *n);
5353
bool activate_node(struct output_t *m, desktop_t *d, node_t *n);
5454
node_t *find_fence(node_t *n, direction_t dir);
55-
bool is_adjacent(node_t *a, node_t *b, direction_t dir);
5655

5756
// node manipulation
5857
void swap_nodes(struct output_t *m1, desktop_t *d1, node_t *n1, struct output_t *m2, desktop_t *d2,
@@ -79,10 +78,7 @@ unsigned int node_area(node_t *n);
7978

8079
// Transaction helpers
8180
void node_set_dirty(node_t *n);
82-
void node_set_pending_size(node_t *n, int width, int height);
83-
void node_set_pending_position(node_t *n, int x, int y);
8481
void node_set_pending_rectangle(node_t *n, struct wlr_box rect);
85-
void node_set_pending_hidden(node_t *n, bool hidden);
8682

8783
// Color helpers
8884
void parse_color(const char *hex, float *color);

src/effects.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -687,9 +687,6 @@ static uint64_t capture_bg_to_tex1_ex(output_t *output, effects_output_t *ctx, b
687687
return result;
688688
}
689689

690-
static struct wlr_box get_client_rect(toplevel_t *tl);
691-
static struct wlr_box get_animated_client_rect(toplevel_t *tl);
692-
693690
// captures scene with blur layer surfaces hidden but blur toplevels visible (for layer blur)
694691
static uint64_t capture_bg_combined(output_t *output, effects_output_t *ctx) {
695692
return capture_bg_to_tex1_ex(output, ctx, false, NULL, NULL, false, false, NULL);
@@ -1218,6 +1215,7 @@ static bool rebuild_live_acrylic(output_t *output, pixman_region32_t *damage,
12181215
pixman_region32_clear(overlap_rgn);
12191216
pixman_region32_union_rect(overlap_rgn, overlap_rgn, r.x - output->lx, r.y - output->ly, r.width,
12201217
r.height);
1218+
pixman_region32_intersect(overlap_rgn, overlap_rgn, damage);
12211219
if (pixman_region32_empty(overlap_rgn))
12221220
continue;
12231221
}

src/input.c

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -562,29 +562,6 @@ void input_apply_config_all_pointers(void) {
562562
input_apply_config(&pointer->wlr_pointer->base);
563563
}
564564

565-
const char *input_config_type_str(enum input_config_type type) {
566-
switch (type) {
567-
case INPUT_CONFIG_TYPE_ANY:
568-
return "any";
569-
case INPUT_CONFIG_TYPE_KEYBOARD:
570-
return "keyboard";
571-
case INPUT_CONFIG_TYPE_POINTER:
572-
return "pointer";
573-
case INPUT_CONFIG_TYPE_TOUCHPAD:
574-
return "touchpad";
575-
case INPUT_CONFIG_TYPE_TOUCH:
576-
return "touch";
577-
case INPUT_CONFIG_TYPE_TABLET:
578-
return "tablet";
579-
case INPUT_CONFIG_TYPE_TABLET_PAD:
580-
return "tablet_pad";
581-
case INPUT_CONFIG_TYPE_SWITCH:
582-
return "switch";
583-
default:
584-
return "unknown";
585-
}
586-
}
587-
588565
void input_init(void) {
589566
ONCE();
590567
for (size_t i = 0; i < num_input_configs; i++) {

src/ipc.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,10 +48,6 @@ static bool desktop_has_urgent(desktop_t *d) {
4848
return false;
4949
}
5050

51-
const char *ipc_get_socket_path(void) {
52-
return socket_path;
53-
}
54-
5551
int ipc_get_socket_fd(void) {
5652
return ipc_socket_fd;
5753
}

src/ipc_cmd/node.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ static void hide_leaves(desktop_t *desk) {
7373
}
7474

7575
static void unlink_and_refocus(node_t *n, desktop_t *src, output_t *mon) {
76-
n->destroying = false;
77-
n->ntxnrefs = 0;
7876
hide_node_client(n);
7977
remove_node(src, n);
8078
if (src->root) {

src/keyboard.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -606,9 +606,9 @@ void toggle_floating(void) {
606606
}
607607

608608
void tile_focused(void) {
609-
node_t *n = mon->desk->focus;
610-
if (n == NULL)
609+
if (mon == NULL || mon->desk == NULL || mon->desk->focus == NULL)
611610
return;
611+
node_t *n = mon->desk->focus;
612612

613613
if (n->client == NULL)
614614
return;
@@ -957,9 +957,9 @@ void toggle_monocle(void) {
957957
}
958958

959959
void set_tiled_layout(void) {
960-
desktop_t *d = mon->desk;
961-
if (mon == NULL || d == NULL)
960+
if (mon == NULL || mon->desk == NULL)
962961
return;
962+
desktop_t *d = mon->desk;
963963

964964
layout_set(d, LAYOUT_TILED);
965965
d->user_layout = LAYOUT_TILED;

src/tree.c

Lines changed: 0 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,27 +1227,6 @@ bool activate_node(output_t *m, desktop_t *d, node_t *n) {
12271227
return focus_node_impl(m, d, n, on_current_desktop);
12281228
}
12291229

1230-
bool is_adjacent(node_t *a, node_t *b, direction_t dir) {
1231-
if (a == NULL || b == NULL)
1232-
return false;
1233-
1234-
struct wlr_box ra = a->rectangle;
1235-
struct wlr_box rb = b->rectangle;
1236-
1237-
switch (dir) {
1238-
case DIR_WEST:
1239-
return ra.x == rb.x + rb.width;
1240-
case DIR_EAST:
1241-
return ra.x + ra.width == rb.x;
1242-
case DIR_NORTH:
1243-
return ra.y + ra.height == rb.y;
1244-
case DIR_SOUTH:
1245-
return ra.y == rb.y + rb.height;
1246-
}
1247-
1248-
return false;
1249-
}
1250-
12511230
node_t *find_fence(node_t *n, direction_t dir) {
12521231
if (n == NULL)
12531232
return NULL;
@@ -1515,24 +1494,6 @@ void node_set_dirty(node_t *n) {
15151494
transaction_add_dirty_node(n);
15161495
}
15171496

1518-
void node_set_pending_size(node_t *n, int width, int height) {
1519-
if (!n)
1520-
return;
1521-
1522-
n->pending.rectangle.width = width;
1523-
n->pending.rectangle.height = height;
1524-
node_set_dirty(n);
1525-
}
1526-
1527-
void node_set_pending_position(node_t *n, int x, int y) {
1528-
if (!n)
1529-
return;
1530-
1531-
n->pending.rectangle.x = x;
1532-
n->pending.rectangle.y = y;
1533-
node_set_dirty(n);
1534-
}
1535-
15361497
void node_set_pending_rectangle(node_t *n, struct wlr_box rect) {
15371498
if (!n)
15381499
return;
@@ -1541,14 +1502,6 @@ void node_set_pending_rectangle(node_t *n, struct wlr_box rect) {
15411502
node_set_dirty(n);
15421503
}
15431504

1544-
void node_set_pending_hidden(node_t *n, bool hidden) {
1545-
if (!n)
1546-
return;
1547-
1548-
n->pending.hidden = hidden;
1549-
node_set_dirty(n);
1550-
}
1551-
15521505
struct wlr_scene_tree *client_get_scene_tree(client_t *client) {
15531506
if (!client)
15541507
return NULL;

0 commit comments

Comments
 (0)