view: use fixed default window width

Now it's not very reasonable to determine the default window width based
on the titlebar geometry, as the titlebar can be shrunk to 1px.

Let's use the fixed value of 100px for simplification.
This commit is contained in:
tokyo4j 2025-09-01 17:29:24 +09:00 committed by Johan Malm
parent 6ed2617394
commit 164b17c279
4 changed files with 9 additions and 20 deletions

View file

@ -744,7 +744,6 @@ view_adjust_size(struct view *view, int *w, int *h)
{
assert(view);
struct view_size_hints hints = view_get_size_hints(view);
int min_width = view_get_min_width();
/*
* "If a base size is not provided, the minimum size is to be
@ -764,7 +763,7 @@ view_adjust_size(struct view *view, int *w, int *h)
/* If a minimum width/height was not set, then use default */
if (hints.min_width < 1) {
hints.min_width = min_width;
hints.min_width = LAB_MIN_VIEW_WIDTH;
}
if (hints.min_height < 1) {
hints.min_height = LAB_MIN_VIEW_HEIGHT;
@ -2412,17 +2411,6 @@ view_reload_ssd(struct view *view)
}
}
int
view_get_min_width(void)
{
int button_count_left = wl_list_length(&rc.title_buttons_left);
int button_count_right = wl_list_length(&rc.title_buttons_right);
return (rc.theme->window_button_width * (button_count_left + button_count_right)) +
(rc.theme->window_button_spacing * MAX((button_count_right - 1), 0)) +
(rc.theme->window_button_spacing * MAX((button_count_left - 1), 0)) +
(2 * rc.theme->window_titlebar_padding_width);
}
void
view_toggle_keybinds(struct view *view)
{