diff --git a/src/dispatch/bind_define.h b/src/dispatch/bind_define.h index 9b61c2a..937ea6c 100644 --- a/src/dispatch/bind_define.h +++ b/src/dispatch/bind_define.h @@ -132,7 +132,7 @@ int togglerow(const Arg *arg) { if (c->isfloating || !ISSCROLLTILED(c) || !VISIBLEON(c, selmon)) return 0; - // Toggle the row (0 <-> 1) + // Toggle the row if (c->dual_scroller_row == 0) { c->dual_scroller_row = 1; } else { @@ -1572,4 +1572,4 @@ int toggle_monitor(const Arg *arg) { } } return 0; -} \ No newline at end of file +} diff --git a/src/fetch/monitor.h b/src/fetch/monitor.h index 8711dbc..cc24792 100644 --- a/src/fetch/monitor.h +++ b/src/fetch/monitor.h @@ -31,8 +31,8 @@ bool is_scroller_layout(Monitor *m) { bool is_row_layout(Monitor *m) { // Layout has independent horizontal rows where navigation should be constrained - // LEFT/RIGHT: stay within same row (same Y) - // UP/DOWN: move between rows + // Moving left and right should keep clients in the same row + // Moving up and down should move clients between rows (this has a dedicaded function) if (m->pertag->ltidxs[m->pertag->curtag]->id == DUAL_SCROLLER) return true; diff --git a/src/layout/horizontal.h b/src/layout/horizontal.h index 6adfd02..9e70196 100644 --- a/src/layout/horizontal.h +++ b/src/layout/horizontal.h @@ -379,7 +379,6 @@ void scroller(Monitor *m) { } // Dual-row scroller layout with independent scrolling -// Top row: 30% of screen height, Bottom row: 70% of screen height void dual_scroller(Monitor *m) { unsigned int i, n_top = 0, n_bottom = 0, n_total = 0; @@ -411,12 +410,12 @@ void dual_scroller(Monitor *m) { return; } - // First pass: count clients per row and assign unassigned clients + // Count clients per row and assign unassigned clients wl_list_for_each(c, &clients, link) { if (VISIBLEON(c, m) && ISSCROLLTILED(c)) { // Assign to bottom row by default if not assigned if (c->dual_scroller_row == -1) { - c->dual_scroller_row = 1; // Default to bottom row + c->dual_scroller_row = 1; } if (c->dual_scroller_row == 0) { @@ -455,13 +454,12 @@ void dual_scroller(Monitor *m) { } } - // Calculate row heights (30% top, 70% bottom) unsigned int top_row_height = (unsigned int)((m->w.height - 2 * cur_gappov - cur_gappiv) * 0.3); unsigned int bottom_row_height = m->w.height - 2 * cur_gappov - cur_gappiv - top_row_height; unsigned int top_row_y = m->w.y + cur_gappov; unsigned int bottom_row_y = top_row_y + top_row_height + cur_gappiv; - // Helper function to layout a single row + // Individual row function void layout_row(Client **row_clients, unsigned int n_row, unsigned int row_y, unsigned int row_height, bool is_top_row) { if (n_row == 0) return; @@ -526,7 +524,7 @@ void dual_scroller(Monitor *m) { m->w.width - 2 * scroller_structs - cur_gappih)) && scroller_prefer_center)); - // Top row: never center + // Current configuration never centers top row if (is_top_row) { should_center = false; } @@ -579,7 +577,6 @@ void dual_scroller(Monitor *m) { layout_row(top_row_clients, n_top, top_row_y, top_row_height, true); layout_row(bottom_row_clients, n_bottom, bottom_row_y, bottom_row_height, false); - // Cleanup free(top_row_clients); free(bottom_row_clients); }