ui: the readouts strip is also shown in a collapsed window

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Martino FerrariandClaude Sonnet 4.6 committed 2026-11-03 10:50:55 +01:00
1 parent 3526ce0541
commit 1d144663b9
4 files changed
+36 -22

No files matched your search

+13 -9
View File
@@ -4338,8 +4338,10 @@ static int dock_width_fits(App& a, int* dock_w, int* side_w) {
}
/// The readouts strip against the dock it mirrors: `same_text=1` when every strip label's text equals the
/// dock's (the cursors' `who` and delta cells, the measurements' values) and the counts agree. `visible` must
/// be the opposite of `dock_shown` (`show-sidebar`), and `h` the strip's fixed 26 whenever it is visible.
/// dock's (the cursors' `who` and delta cells, the measurements' values) and the counts agree. The strip is
/// shown whenever the dock is not beside the plot, so `expected` is `!dock_shown || collapsed` (`dock_shown`
/// is `show-sidebar`, `collapsed` the split view's, both read in the same frame as `visible`), `visible_ok`
/// is `visible == expected`, and `h` is the strip's fixed 26 whenever it is visible.
/// `sens_same` is the strip's cursor chips sharing the dock grid's sensitivity.
static void strip_report(App& a, const char* tag, const char* what) {
const auto text = [](GtkWidget* w) { return std::string(gtk_label_get_text(GTK_LABEL(w))); };
@@ -4363,13 +4365,15 @@ static void strip_report(App& a, const char* tag, const char* what) {
const bool collapsed =
a.side_view != nullptr &&
adw_overlay_split_view_get_collapsed(ADW_OVERLAY_SPLIT_VIEW(a.side_view)) != FALSE;
const bool expected = !dock_shown || collapsed;
const bool sens_same =
a.strip_cursor_box != nullptr && a.dock_cursor_grid != nullptr &&
gtk_widget_get_sensitive(a.strip_cursor_box) == gtk_widget_get_sensitive(a.dock_cursor_grid);
std::fprintf(stderr,
"[%s-probe] %-14s strip: visible=%d dock_shown=%d cursors=%zu measures=%zu same_text=%d "
"h=%d sens_same=%d collapsed=%d window=%d\n",
tag, what, visible ? 1 : 0, dock_shown ? 1 : 0, a.strip_cursor_deltas.size(),
"[%s-probe] %-14s strip: visible=%d expected=%d visible_ok=%d dock_shown=%d cursors=%zu "
"measures=%zu same_text=%d h=%d sens_same=%d collapsed=%d window=%d\n",
tag, what, visible ? 1 : 0, expected ? 1 : 0, visible == expected ? 1 : 0,
dock_shown ? 1 : 0, a.strip_cursor_deltas.size(),
a.strip_measure_labels.size(), same, a.readouts_strip != nullptr
? gtk_widget_get_height(a.readouts_strip) : -1,
sens_same ? 1 : 0, collapsed ? 1 : 0,
@@ -4378,10 +4382,10 @@ static void strip_report(App& a, const char* tag, const char* what) {
/// Puts the dock away through the wish the tick re-asserts and reads the strip with it hidden
/// (`<tag>-probe ... strip:`: visible must be 1, h 26, same_text 1), then restores the wish and reads it
/// again (visible must be 0). Under `xvfb-run` the window is 756 px wide, below `kSidebarRoom`, so the split
/// view is `collapsed` on every line: both legs are the collapsed case (the tick keeps a wished dock
/// overlaid, a hidden one off), and `collapsed=0` is not reachable from a probe -- a window with no
/// manager cannot be resized by `gtk_window_set_default_size()`.
/// again. Under `xvfb-run` the window is 756 px wide, below `kSidebarRoom`, so the split view is `collapsed`
/// on every line and the strip is visible on every line, the restored one included (the tick keeps a wished
/// dock overlaid, a hidden one off); the wide case, where the restored dock hides the strip, is not reachable
/// from a probe -- a window with no manager cannot be resized by `gtk_window_set_default_size()`.
struct StripDrive {
App* app;
const char* tag;