mirror of
https://github.com/swaywm/sway.git
synced 2024-11-29 11:21:28 +00:00
Ensure predicted position for short text handling doesn't overflow.
- Predicted status line can be negative, so corresponding variables should not be unsigned. Changed to double as position is actually calculated as double.
This commit is contained in:
parent
0553e75b53
commit
94dc57f3c5
|
@ -454,10 +454,11 @@ static uint32_t render_status_line_i3bar(cairo_t *cairo,
|
||||||
bool use_short_text = false;
|
bool use_short_text = false;
|
||||||
|
|
||||||
// TODO: Add margin here?
|
// TODO: Add margin here?
|
||||||
uint32_t reserved_width = predict_workspace_buttons_length(cairo, output) +
|
double reserved_width =
|
||||||
|
predict_workspace_buttons_length(cairo, output) +
|
||||||
predict_binding_mode_indicator_length(cairo, output);
|
predict_binding_mode_indicator_length(cairo, output);
|
||||||
|
|
||||||
uint32_t predicted_full_pos =
|
double predicted_full_pos =
|
||||||
predict_status_line_pos(cairo, output, *x);
|
predict_status_line_pos(cairo, output, *x);
|
||||||
|
|
||||||
if (predicted_full_pos < reserved_width) {
|
if (predicted_full_pos < reserved_width) {
|
||||||
|
|
Loading…
Reference in a new issue