mirror of
https://github.com/swaywm/sway.git
synced 2024-11-26 01:41:30 +00:00
Handle border width and height on minimum floating sizes
This fixes: https://github.com/swaywm/sway/issues/5337 Co-authored-by: Moon Sungjoon <sumoon@seoulsaram.org>
This commit is contained in:
parent
0b4e3d39eb
commit
f2b6d1ec29
|
@ -81,16 +81,24 @@ static void handle_pointer_motion(struct sway_seat *seat, uint32_t time_msec) {
|
|||
int min_width, max_width, min_height, max_height;
|
||||
floating_calculate_constraints(&min_width, &max_width,
|
||||
&min_height, &max_height);
|
||||
width = fmax(min_width + border_width, fmin(width, max_width));
|
||||
height = fmax(min_height + border_height, fmin(height, max_height));
|
||||
width = fmin(width, max_width - border_width);
|
||||
width = fmax(width, min_width + border_width);
|
||||
width = fmax(width, 1);
|
||||
height = fmin(height, max_height - border_height);
|
||||
height = fmax(height, min_height + border_height);
|
||||
height = fmax(height, 1);
|
||||
|
||||
// Apply the view's min/max size
|
||||
if (con->view) {
|
||||
double view_min_width, view_max_width, view_min_height, view_max_height;
|
||||
view_get_constraints(con->view, &view_min_width, &view_max_width,
|
||||
&view_min_height, &view_max_height);
|
||||
width = fmax(view_min_width + border_width, fmin(width, view_max_width));
|
||||
height = fmax(view_min_height + border_height, fmin(height, view_max_height));
|
||||
width = fmin(width, view_max_width - border_width);
|
||||
width = fmax(width, view_min_width + border_width);
|
||||
width = fmax(width, 1);
|
||||
height = fmin(height, view_max_height - border_height);
|
||||
height = fmax(height, view_min_height + border_height);
|
||||
height = fmax(height, 1);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue